Skip to content

Latest commit

Β 

History

History
86 lines (66 loc) Β· 2.7 KB

index.md

File metadata and controls

86 lines (66 loc) Β· 2.7 KB

Functions

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 with message or opts.defaultMessage (if specified).

stopAndRestart() β‡’ number

stopAndRestart - Stops timer, starts a new one and returns the nanosecond diff of the stopped timer.

config(userOpts) β‡’ void

config - Accepts a config object to adjust default settings.

Kind: global function

Param Type
userOpts object

start() β‡’ number

start - Starts a new timer and returns the absolute start time.

Kind: global function
Returns: number - nsStartTime

stop() β‡’ number

stop - Stops the current timer and returns the absolute end time.

Kind: global function
Returns: number - nsEndTime

diff(nsStartTime, nsEndTime) β‡’ number

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(message) β‡’ 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() β‡’ number

stopAndRestart - Stops timer, starts a new one and returns the nanosecond diff of the stopped timer.

Kind: global function
Returns: number - nsDiff