GPX Lap Timer turns a recorded GPS track into lap times. Define a virtual start/finish line as two coordinates, and the tool finds every point where your track crosses that line, then measures the time between consecutive crossings. It works for any looping activity — track days, criteriums, running laps — and runs entirely in your browser.
How it works
The track is read into an ordered list of points, each with a longitude, latitude, and timestamp. The gate is a line segment defined by two coordinates. For every consecutive pair of track points, the tool tests whether the segment between them intersects the gate using the orientation-based segment intersection test: two segments cross when their endpoints straddle each other, detected via the sign of cross products.
When a crossing is found, the exact moment is interpolated. The intersection’s position along the track segment gives a fraction t, and the crossing time is time₁ + t × (time₂ − time₁). The duration of each lap is the difference between consecutive crossing times. A cooldown after each crossing suppresses duplicate triggers from points sitting right on the line.
Tips and example
Place the gate perpendicular to your direction of travel and wide enough to span the racing line, but short enough that the track only crosses it once per lap. If your fastest lap is, say, 90 seconds, a 10-second cooldown comfortably prevents double counts without missing real laps. Paste the sample, keep the suggested gate, and you will see the crossings and per-lap durations listed in order.