1.1.7 • Published 7 years ago

clock-timer.js v1.1.7

Weekly downloads
10
License
MIT
Repository
github
Last release
7 years ago

clock-timer.js Build Status

Greenkeeper badge

Timing Events tied to clock.js.

ClockTimer is a subclass of Clock, which adds methods to handle timeout and intervals relying on Clock's ticks.

Why?

Once built-in setTimeout and setInterval relies on CPU load, functions may delay an unexpected amount of time to execute. Having it tied to a clock's time is guaranteed to execute in a precise way.

See a quote from W3C Timers Specification:

This API does not guarantee that timers will fire exactly on schedule. Delays due to CPU load, other tasks, etc, are to be expected.

API

Clock

  • setInterval(handler, time, ...args) -> Delayed
  • setTimeout(handler, time, ...args) -> Delayed
  • clear() - clear all intervals and timeouts.

Delayed

  • active -> Boolean - Is it still active?
  • clear() -> void - Clear timeout/interval
  • reset() -> void - Reset elapsed time

License

MIT

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5-beta.5

7 years ago

1.1.5-beta.4

7 years ago

1.1.5-beta.3

7 years ago

1.1.5-beta.2

7 years ago

1.1.5-beta.1

7 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago