clock-util
An extended Clock with additional functionality
installation
> npm install clock-util
usage
default to system clock:
const ClockUtil = const clock =
or wrap any Clock:
const fixedClock = 123456const clock = fixedClock
now we have some extra utility methods available:
// Returns the timestamp in milliseconds since the Unix epoch from the current clock time// this is the same as Clock interfaceclock// => 123456 clock // Returns a Date object from the current clock time// => new Date(123456) clock // Returns the number of seconds since the Unix epoch// => 123
license
ISC