package summerizers import "github.com/johnjones4/model-rocket-telemetry/dashboard/core" func timeInMode(fd []core.DataSegment, mode core.FlightMode) float64 { startTime := -1.0 for _, d := range fd { if d.Computed.FlightMode == mode && startTime < 0 { startTime = d.Raw.flightTime } else if d.Computed.FlightMode != mode && startTime > 0 { return d.Raw.flightTime - startTime } } return 0 }