import { Interval } from 'ctrl-timer'
const timer = new Interval()
timer.setInterval(() => {
console.log('hello-world!')
}, 1000)
timer.clearInterval()
// not work
timer.pause()
// not work
timer.restart()
Timeout
import { Timeout } from 'ctrl-timer'
const timer = new Timeout()
timer.setTimeout(() => {
console.log('hello-world!')
}, 1000)
Interval / Timeout static methods
import { Interval } from 'ctrl-timer'
const timer = new Timeout()
timer.setTimeout(() => {
console.log('hello-world!')
}, 1000)
Interval.pause()
Interval.restart()
Interval.clearInterval()