diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-04-07 01:23:29 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-04-07 01:23:29 +0530 |
commit | 1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca (patch) | |
tree | 32d32d7f33b2ca64cf101006442b1b17bfaf61aa /src/util/timer.ts | |
parent | 47787c0b0b846d5f4a057661efdd05d8786032f1 (diff) | |
download | wallet-core-1471aae8927c20d646cc2aa5ab0e20c1a7f2c0ca.tar.xz |
linter / simpler webextension pack
Diffstat (limited to 'src/util/timer.ts')
-rw-r--r-- | src/util/timer.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/util/timer.ts b/src/util/timer.ts index a1712b03f..18132a812 100644 --- a/src/util/timer.ts +++ b/src/util/timer.ts @@ -1,5 +1,3 @@ -import { Duration } from "./time"; - /* This file is part of GNU Taler (C) 2017-2019 Taler Systems S.A. @@ -24,6 +22,12 @@ import { Duration } from "./time"; */ /** + * Imports. + */ +import { Duration } from "./time"; + + +/** * Cancelable timer. */ export interface TimerHandle { @@ -33,7 +37,7 @@ export interface TimerHandle { class IntervalHandle { constructor(public h: any) {} - clear() { + clear(): void { clearInterval(this.h); } } @@ -41,7 +45,7 @@ class IntervalHandle { class TimeoutHandle { constructor(public h: any) {} - clear() { + clear(): void { clearTimeout(this.h); } } @@ -55,7 +59,7 @@ export const performanceNow: () => number = (() => { const t = process.hrtime(); return t[0] * 1e9 + t[1]; }; - } else if (typeof "performance" !== "undefined") { + } else if (typeof performance !== "undefined") { return () => performance.now(); } else { return () => 0; @@ -93,7 +97,7 @@ export class TimerGroup { private idGen = 1; - stopCurrentAndFutureTimers() { + stopCurrentAndFutureTimers(): void { this.stopped = true; for (const x in this.timerMap) { if (!this.timerMap.hasOwnProperty(x)) { |