// 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 { await sendAsync("op_global_timer", { timeout }); } export function now(): NowResponse { return sendSync("op_now"); }