Skip to content

Instantly share code, notes, and snippets.

@johnloven
Last active June 11, 2025 07:51
Show Gist options
  • Save johnloven/2d954b120983665e57abaf02c651672a to your computer and use it in GitHub Desktop.
Save johnloven/2d954b120983665e57abaf02c651672a to your computer and use it in GitHub Desktop.
OnPace

OnPace

Are you on pace?

OnPace is a Garmin Smartwatch data field for runners that displays how far ahead/behind you are your target pace.

Table of Contents

Motivation

I was running a race through a tunnel without a GPS signal and wanted to pace myself using distance markers along the course.

Features

  • Displays how far ahead/behind you are your target pace in an easy to read data field that fits among your other data fields using the same styling.
  • Continous update using elapsed distance.
  • You can override the elapsed distance with the lap key.

Settings

These are set using the Garmin Connect IQ mobile app.

Distance unit

Choose between:

  • Kilometers
  • Miles
  • Meters
  • Feet
Lap distance

Used together with Target pace (seconds per lap) to calculate how far ahead/behind you are your taget pace. It is also the distance of each lap when using Override distance with lap key.

Target pace (seconds per lap)

Your target time in seconds for running one Lap distance.

Update continously using elapsed distance

Toggle on or off. Can be used with or without Override distance with lap key.

Override distance with lap key

Toggle on or off. Can be used with or without Update continously using elapsed distance.

Note: Remember to disable your watch's auto-lap function if this setting is toggled on.

UI

Font size

Make sure the text fits in the field. Choose between:

  • Large (default)
  • Medium
  • Small
Ahead text color

Text color when ahead of target pace. Choose between:

  • Black (default)
  • Green
  • White
Behind text color

Text color when behind target pace. Choose between:

  • Black
  • Red
  • White (default)
Ahead background color

Background color when ahead of target pace. Choose between:

  • Black
  • Green (default)
  • White
Behind background color

Background color when behind target pace. Choose between:

  • Black
  • Red (default)
  • White

What settings should I use?

Set your target pace using Distance unit, Lap distance and Target pace (seconds per lap).

Choose Update continously using elapsed distance and Override distance with lap key depending on what kind of run you are doing. Here are a few scenarios where each combination might be useful.

Update continously using elapsed distance Override distance with lap key Useful for
on off
  • Outside runs when you trust the GPS.
  • Outside runs when you already use the lap key for something else (e.g. auto-laps or structured workouts).
off on
  • Inside track runs.
on on
  • Outside track runs when you want to pace yourself to the track distance.
  • Outside runs with distance markers where you want to account for GPS inconsistences.
  • Outside races with distance markers where you want to pace yourself to the race distance (e.g. you want to run a marathon in 4 hours).

If using Override distance with lap key, remember to set the Lap distance equal to the distance between the course distance markers, and to turn your watch's auto-lap feature off.

Example with different settings

Lets say you have configured your target pace to be 5:00/km using the following settings:

  • Distance unit: Kilometers
  • Lap distance: 1
  • Target pace (seconds per lap): 300

You run what the watch says is 1100 meters in 4:50 and press the lap key because there was a "1km" distance marker along the course. You then run another 500 meters (according to the watch) in 2:25.

Depending on your chosen combination of the other settings, the displayed value will be calculated differently.

Update continously using elapsed distance Override distance with lap key Displayed value
on off Lap key presses are ignored. According to the watch we have run 1600 meters in 7:15. Since our taget pace is 5:00/km our target time for this distance is 5:00 * 1.6 = 8:00, which means we are 0:45 ahead. During these 7:15 the field updates every second with how far ahead/behind we are in each moment and after 7:15 the app displays -0:45.
off on Elapsed distance is ignored and the app only updates when we press the lap key. For the first 4:50 the app doesn't know we have moved and displays -0:00. At 4:50 we press the lap key which tells the app that we have run 1km. This is 0:10 faster than our target pace and the app therefore displays -0:10. It will keep displaying the same value for the next 2:25.
on on Using elapsed distance the app calculates that we run the first 1100 meters in 4:50. Since our taget pace is 5:00/km our target time for this distance is 5:00 * 1.1 = 5:30, which means we are 0:40 ahead. During these 4:50 the field updates every second with how far ahead/behind we are in each moment and after 4:50 the app displays -0:40. When we press the lap key at 4:50 we tell the app that the actual distance we have run is 1km, meaning we are actually only 0:10 ahead, and the app will update to display -0:10. After another 2:25 the app calculates that we have run a total of 1500 meters in 7:15, since it still counts the first lap to be 1km. Since our taget pace is 5:00/km our target time for this distance is 5:00 * 1.5 = 7:30, which means we are now 0:15 ahead. During these last 2:25 the field updates every second with how far ahead/behind we are in each moment and after 7:15 the app displays -0:15.
off off This is not a reasonable combination and the app will display 0:00 with a grey background.

What is actually correct?

Lets say that our actual pace throughout this run was 4:50/km, the km marker was in the correct location, and the GPS measured the first 1km consistently longer than it was. Then the different setting combinations would display the following values over time:

Settings comparison

What you actually choose to use is up to you.

Tips

  • Add the built-in data field showing the lap number next to this data field to easily see how many laps you have tracked.

Caveats

  • Some watches have an auto-lap function. If you have Override distance with lap key on, remember to turn off this function.
  • Some watches show a "Discard lap" button right after you press the lap key. The "Discard lap" action is not registered by the app (because this functionality is not available in the SDK) and if you press it the lap will still count. If you have Override distance with lap key on you should therefore never click the "Discard lap" button. If you still do it by accident, remember that the app still registered it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment