Skip to content

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.

number

Total pedal revolutions in the window.

number

Elapsed time in milliseconds (truncated internally).

number

Revolutions per minute (rounded), or 0 when undefined.

computeBikeRpm(15, 6543); // 138 (6543ms → 6500ms → round(15·60000/6500))