drunk-timer

Stable timer API

Usage no npm install needed!

<script type="module">
  import drunkTimer from 'https://cdn.skypack.dev/drunk-timer';
</script>

README

drunk-timer

Build Status NPM Version Bower

Staggering timer API

demo: drunk-mertonome

Installation

npm:

npm install drunk-timer

bower:

bower install drunk-timer

downloads:

API

  • config(opts={}): void
  • setInterval(callback: function, delay: number): number
  • clearInterval(timerId: number): void
  • setTimeout(callback: function, delay: number): number
  • clearTimeout(timerId: number): void

Config options

  • drunk: function default: ``(value, rand)=> value ± rand 10%`
  • timerAPI: object default: window || global
  • rand: function default: Math.random

License

MIT