From b5ee6b7b4ee506712f51e1b90e9256c4b0c0c603 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 2 Dec 2019 17:35:47 +0100 Subject: pending operations WIP --- src/util/timer.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/util/timer.ts') diff --git a/src/util/timer.ts b/src/util/timer.ts index d3bb5d485..865c17faf 100644 --- a/src/util/timer.ts +++ b/src/util/timer.ts @@ -105,6 +105,14 @@ export class TimerGroup { } } + resolveAfter(delayMs: number): Promise { + return new Promise((resolve, reject) => { + this.after(delayMs, () => { + resolve(); + }); + }); + } + after(delayMs: number, callback: () => void): TimerHandle { if (this.stopped) { console.warn("dropping timer since timer group is stopped"); -- cgit v1.2.3