new Interval(func, delay, lifetime)
Interval.js
Parameters:
Name | Type | Description |
---|---|---|
func |
function | The function you want to be called repeatly |
delay |
int | milliseconds that should wait before each call |
lifetime |
int | if set, clearInterval will be called after `lifetime` milliseconds |
- Source:
Methods
-
once()
-
Run func once
- Source:
-
pause()
-
clearInterval without touching lifetime
- Source:
-
resume()
-
setInterval if not set
- Source:
-
start(delay, lifetime)
-
setInterval & setTimeout for clearInterval if lifetime set
Parameters:
Name Type Description delay
int milliseconds that should wait before each call, defaults to this.delay lifetime
int if set, clearInterval will be called after `lifetime` milliseconds, defaults to this.lifetime - Source:
-
stop()
-
clearInterval and clearTimeout for lifetime
- Source: