Skip to content

fand/worker-timer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

worker-timer

Build Status

Stable timer API

diff from original mohayonao/worker-timer

In original worker-timer, it creates timer object for each setTimeout() setInterval() call. This repository prevents killing timer object and reusing them. We can also delete timers explicitly via deleteTimer().

Installation

Use npm:

npm install --save fand/worker-timer

API

  • setInterval(callback: function, delay: number, timerId: number): number
  • clearInterval(timerId: number, preserveTimer: boolean): void
  • setTimeout(callback: function, delay: number, timerId: number): number
  • clearTimeout(timerId: number, preserveTimer: boolean): void
  • deleteTimer(timerId: number): void

License

MIT

About

Stable timer API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 96.1%
  • Shell 3.9%