MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / scheduleTimer

Function scheduleTimer

clear_sticker/clear_sticker.ts:14–21  ·  view source on GitHub ↗
(fn: () => void, ms: number)

Source from the content-addressed store, hash-verified

12const pendingTimers = new Set<ReturnType<typeof setTimeout>>();
13
14function scheduleTimer(fn: () => void, ms: number): ReturnType<typeof setTimeout> {
15 const t = setTimeout(() => {
16 pendingTimers.delete(t);
17 fn();
18 }, ms);
19 pendingTimers.add(t);
20 return t;
21}
22
23
24class ClearStickerPlugin extends Plugin {

Callers 1

handleClearStickerMethod · 0.70

Calls 3

fnFunction · 0.85
deleteMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected