blob: 2fdbd68518f2dfbd1096fa1f434b27ea22057788 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// 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");
}
export async function startGlobalTimer(timeout: number): Promise<void> {
await sendAsync("op_global_timer", { timeout });
}
export function now(): NowResponse {
return sendSync("op_now");
}
|