mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
timer moved in separate module
This commit is contained in:
16
timer/Readme.md
Normal file
16
timer/Readme.md
Normal 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)
|
||||
```
|
||||
Reference in New Issue
Block a user