MCPcopy Index your code
hub / github.com/JavaCS3/xterm-player / IntervalTicker

Class IntervalTicker

src/Timer.ts:40–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40export class IntervalTicker implements ITicker {
41 private _tid: NodeJS.Timeout | null = null
42
43 public constructor(public interval: number = TICK_INTERVAL) { }
44
45 public get running(): boolean { return this._tid != null }
46 public start(cb: TickerCallback): void {
47 this.stop()
48 this._tid = setInterval(cb, this.interval)
49 }
50 public stop(): void {
51 if (this._tid) {
52 clearInterval(this._tid)
53 this._tid = null
54 }
55 }
56 public now(): number { return Date.now() }
57}
58
59export class AnimationFrameTicker implements ITicker {
60 private _rafid: number = 0

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected