Skip to main content

Time

Helper functions having to do with time.

Functions

getElapsedSeconds()

function getElapsedSeconds(startTime, roundToInteger?): number;

Defined in: functions/time.ts:21

Helper function to get the number of elapsed seconds since a starting time.

By default, this function will return a whole number (using Math.floor on the result), but this can be disabled with the "roundToInteger" parameter.

For example:

const startTime = Date.now();
doSomething();
const elapsedSeconds = getElapsedSeconds(startTime);

Parameters

ParameterTypeDefault value
startTimenumberundefined
roundToIntegerbooleantrue

Returns

number