Skip to main content

functions/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

ParameterType
startTimenumber

Returns

number

Defined in

functions/time.ts:14