Skip to main content

Lap-Time Format

Lap times are stored internally as milliseconds (lapTimeMs) and displayed using the format string family m:ss.000.

Storage

Across the API, all timing values use these conventions:

FieldTypeUnitExample
lapTimeMsint64ms92345 (= 1:32.345)
sectorTimeMsint64[]ms[31050, 30200, 31095]
pitTimeMsint64ms21345

This keeps arithmetic exact — Avg(laps.lapTimeMs) doesn't lose precision the way decimal-seconds would.

Display

The default format string is m:ss.000:

Stored msDisplay
923451:32.345
600011:00.001
451230:45.123
366123461:01.234 (note: minutes don't roll over to hours unless you use h:mm:ss.000)

Other useful format strings:

Format92345 ms becomesUse case
m:ss.0001:32.345Lap time
m:ss.fff1:32.345Same — f is alias for 0
s.fff92.345Sector / delta
h:mm:ss.0000:01:32.345Endurance race elapsed
+s.fff+92.345Signed delta

Highlights

The Run Sheet Main tab applies HH-DM-style chip highlights:

ColourWhen
Purple (#A855F7)Session fastest lap or sector
Green (#22C55E)Personal best for the car
(default)Regular lap

The colours are defined in apps/client/lib/src/theme/race_theme.dart as RaceColors.fastestPurple and RaceColors.personalBestGreen.

Editing lap times

In the Run Sheet Main tab, you can type a lap time as either:

  • "1:32.345" — minutes:seconds.thousandths
  • "92.345" — total seconds with decimal
  • "92345" — raw milliseconds

The editor parses all three formats and stores the canonical millisecond integer.

What's coming

  • Configurable highlight thresholds — today they're hard-coded to "fastest" and "personal best"
  • Class-relative highlights — fastest in class, not just overall
  • Sector-by-sector best of best stitching