Time
Helper functions having to do with time.
Functions
getElapsedSeconds()
function getElapsedSeconds(startTime): number
Helper function to get the number of elapsed seconds since a starting time.
This function always returns a whole number (using Math.floor
on the result).
For example:
const startTime = Date.now();
doSomething();
const elapsedSeconds = getElapsedSeconds(startTime);
Parameters
Parameter | Type |
---|---|
startTime | number |
Returns
number