computeBikeRpm
computeBikeRpm(
cyclingCount,durationMs):number
Defined in: console-sdk/src/units/index.ts:428
Bike cadence (RPM) from a pedal-revolution count and duration in
milliseconds, replicating the firmware’s 100ms-resolution truncation:
duration is floored to the nearest 100ms ((time_ms / 100) · 100) before the
rate is computed. A truncated duration of zero yields 0.
Parameters
Section titled “Parameters”cyclingCount
Section titled “cyclingCount”number
Total pedal revolutions in the window.
durationMs
Section titled “durationMs”number
Elapsed time in milliseconds (truncated internally).
Returns
Section titled “Returns”number
Revolutions per minute (rounded), or 0 when undefined.
Example
Section titled “Example”computeBikeRpm(15, 6543); // 138 (6543ms → 6500ms → round(15·60000/6500))