- config(userOpts) β
void
config - Accepts a config object to adjust default settings.
- start() β
number
start - Starts a new timer and returns the absolute start time.
- stop() β
number
stop - Stops the current timer and returns the absolute end time.
- diff(nsStartTime, nsEndTime) β
number
diff - Accepts a start & end time in nanoseconds and returns the difference.
- stopAndDiff(message) β
number
stopAndDiff - Combines stop() & diff(). If
opts.shouldPrint
is set, the diff is logged to the console withmessage
oropts.defaultMessage
(if specified).- stopAndRestart() β
number
stopAndRestart - Stops timer, starts a new one and returns the nanosecond diff of the stopped timer.
config - Accepts a config object to adjust default settings.
Kind: global function
Param | Type |
---|---|
userOpts | object |
start - Starts a new timer and returns the absolute start time.
Kind: global function
Returns: number
- nsStartTime
stop - Stops the current timer and returns the absolute end time.
Kind: global function
Returns: number
- nsEndTime
diff - Accepts a start & end time in nanoseconds and returns the difference.
Kind: global function
Returns: number
- nsDiff
Param | Type |
---|---|
nsStartTime | number |
nsEndTime | number |
stopAndDiff - Combines stop() & diff().
If opts.shouldPrint
is set, the diff is logged to the console
with message
or opts.defaultMessage
(if specified).
Kind: global function
Returns: number
- nsDiff
Param | Type | Description |
---|---|---|
message | string |
Optional message for logging. |
stopAndRestart - Stops timer, starts a new one and returns the nanosecond diff of the stopped timer.
Kind: global function
Returns: number
- nsDiff