clockwise
v1.0.0
Published
A simple, configurable clock
Downloads
5
Readme
clockwise
A simple, configurable clock
Install
$ npm install --save clockwise
Usage
var Clock = require('clockwise')
var clock = new Clock()
clock.time() // => current time
clock.set(function timer () {
return 1000
})
clock.time() // => time is 1000
API
new Clock()
Constructs a new clock instance that defaults to the normal clock
clock.time()
-> Integer
Returns the current time
clock.set(timer)
-> clock
timer
Required
Type: function
The new function to use to generate the current time
clock.restore()
-> clock
Restores the clock to the normal behavior
License
MIT © Ben Drucker