Calculate pace for a given time and distance
Install
$ npm install --save snailpace
Usage
const snailpace = ; ;//=> 720000 (ms/km) ;//=> 1158727.68 (ms/mi) ;//=> 0.72 (s/m)
Protip: use with moment.utc(snailpace({ ... )).format()
API
snailpace(options)
options
time
Type: number
Time in milliseconds
distance
Type: number
Distance in meters
timeDivider
Type: number
Default: 1
(1 ms)
Calculate pace in this unit of time per distance
distanceDivider
Type: number
Default: 1000
(1 km)
Calculate pace in this unit of distance per time
metric
Type: boolean
Default: true
License
MIT © Pier-Luc Gendreau