summaryrefslogtreecommitdiff
path: root/cli/js/ops/timers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/ops/timers.ts')
-rw-r--r--cli/js/ops/timers.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/cli/js/ops/timers.ts b/cli/js/ops/timers.ts
index 1a7081df0..2fdbd6851 100644
--- a/cli/js/ops/timers.ts
+++ b/cli/js/ops/timers.ts
@@ -1,6 +1,12 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+
import { sendSync, sendAsync } from "./dispatch_json.ts";
+interface NowResponse {
+ seconds: number;
+ subsecNanos: number;
+}
+
export function stopGlobalTimer(): void {
sendSync("op_global_timer_stop");
}
@@ -9,11 +15,6 @@ export async function startGlobalTimer(timeout: number): Promise<void> {
await sendAsync("op_global_timer", { timeout });
}
-interface NowResponse {
- seconds: number;
- subsecNanos: number;
-}
-
export function now(): NowResponse {
return sendSync("op_now");
}