MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / start

Method start

tools/testmc/main.js:48–66  ·  view source on GitHub ↗
(interval)

Source from the content-addressed store, hash-verified

46
47 clear() {}
48 start(interval) {
49 if (!this.#timer) {
50 this.#timer = Timer.set(() => {
51 this.doIdle();
52 }, 1, 100);
53 Timer.schedule(this.#timer);
54 }
55
56 const timer = this.#timer;
57 if (!timer) return;
58
59 if (interval <= 5)
60 interval = 5;
61 if (timer.interval === interval)
62 return;
63
64 Timer.schedule(timer, interval, interval);
65 timer.interval = interval;
66 }
67 stop() {
68 const timer = this.#timer;
69 if (!timer) return;

Callers

nothing calls this directly

Calls 3

doIdleMethod · 0.95
scheduleMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected