timer moved in separate module

This commit is contained in:
Vladimir Enchev
2014-05-10 16:34:23 +03:00
parent fbdb0e5523
commit db1681a88e
8 changed files with 36 additions and 27 deletions

16
timer/Readme.md Normal file
View File

@@ -0,0 +1,16 @@
Timer module. Functions also can be availble in the global context if you require *globals* module.
```js
require("globals");
setTimeout(function(){ log("Test"); }, 2000);
var id = setTimeout(function(){ log("Test"); }, 2000);
...
clearTimeout(id);
setInterval(function(){ log("Test"); }, 2000);
var intervalId = setInterval(function(){ log("Test"); }, 2000);
...
clearInterval(intervalId)
```