1.0.0 • Published 9 years ago

clockwise v1.0.0

Weekly downloads
9
License
MIT
Repository
github
Last release
9 years ago

clockwise Build Status

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