}
reset (t: number) {
- this.stop()
+ clearTimeout(this.#timeout)
+ clearInterval(this.#ticker)
this.#remaining = t
this.#start = performance.now()
this.#ticker = setInterval(Function.prototype, 1000)
this.#timeout = setTimeout(this.#f, this.#remaining)
+ this.#isPaused = false
}
resume () {
this.#isPaused = false
}
}
-
- stop () {
- clearTimeout(this.#timeout)
- clearInterval(this.#ticker)
- this.#remaining = 0
- this.#start = 0
- this.#isPaused = false
- }
}