Clock, Runtime, Gaptime
Last updated
Last updated
{{
# Get current TOD and convert to seconds
now = timespan.Now | ToSeconds
# Fetch race start time and winner time from Globals List and convert to seconds (this way RR12 field can be seconds or HH:mm:ss string
raceStartedAt = StartAndWinnerList.First.Starttime | ToSeconds
winnerFinishedAt = StartAndWinnerList.First.Winnertime | ToSeconds
# Determine race states
isRaceStarted = raceStartedAt > 0
# Determine output based on is race started or not
if isRaceStarted
# Race is started, check for winner time is present
isWinnerFinished = winnerFinishedAt > 0
if (isWinnerFinished)
# Winnner is finished, show gap time
# Calculate gap time
timeSinceWinner = now - winnerFinishedAt
timeSinceWinner | gaz.Format "Seconds" false
else
# No winner present, show running time
# Calculate runtime
timeSinceStart = now - raceStartedAt
timeSinceStart | gaz.Format "Seconds" false
end
else
# Before Start
""
end
}}