summaryrefslogtreecommitdiff
path: root/cli/js/ops/timers.ts
blob: bc7fe6453e140cd795e6113f01b261f41733fb09 (plain)
1
2
3
4
5
6
7
8
9
10
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { sendSync, sendAsync } from "./dispatch_json.ts";

export function stopGlobalTimer(): void {
  sendSync("op_global_timer_stop");
}

export async function startGlobalTimer(timeout: number): Promise<void> {
  await sendAsync("op_global_timer", { timeout });
}