Global

Methods

log()

Source:
Log the Horloge instance

raw() → {Object}

Source:
Returns the raw values for start, end and (optionally) the difference between the two
Returns:
raw
Type
Object

reset()

Source:
Initialises start and end times to null

start()

Source:
Records the start time

stop()

Source:
Records the end time and sets the difference

stopAndLog()

Source:
Convenience function to stop the timer and log the result

toMs() → {String}

Source:
Convert time in milliseconds to a readable format, with provided options
Returns:
Readable time with unit
Type
String

toString()

Source:
Override for the toString method

wrapFunction(fn, callback) → {Horloge}

Source:
Wraps a function with a callback and calls it, recording start and end time
Parameters:
Name Type Description
fn function The function to wrap
callback function Callback to call when `fn` finishes
Returns:
An Horloge instance
Type
Horloge

wrapPromise(p) → {Horloge}

Source:
Wraps a promise and calls it, recording start and end time
Parameters:
Name Type Description
p Promise The promise to wrap
Returns:
An Horloge instance
Type
Horloge