Skip to content

computeSpm

computeSpm(strokeCount, durationSeconds): number

Defined in: console-sdk/src/units/index.ts:399

Strokes-per-minute from a stroke count and duration, replicating the firmware’s decisecond truncation: the console stores duration in 0.1s units and divides by 10 with integer division, so 4.3s becomes 4s before the rate is computed. A truncated duration under one second yields 0 (the console shows no rate yet).

number

Total strokes in the window.

number

Elapsed time in seconds (truncated internally).

number

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

computeSpm(4, 4.3); // 60 (floor(4.3)=4 → round(240/4))