summaryrefslogtreecommitdiff
path: root/cli/js/performance.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/performance.ts')
-rw-r--r--cli/js/performance.ts9
1 files changed, 2 insertions, 7 deletions
diff --git a/cli/js/performance.ts b/cli/js/performance.ts
index 9d49e6a4c..7aaa35952 100644
--- a/cli/js/performance.ts
+++ b/cli/js/performance.ts
@@ -1,10 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { sendSync } from "./ops/dispatch_json.ts";
-
-interface NowResponse {
- seconds: number;
- subsecNanos: number;
-}
+import { now as opNow } from "./ops/timers.ts";
export class Performance {
/** Returns a current time from Deno's start in milliseconds.
@@ -15,7 +10,7 @@ export class Performance {
* console.log(`${t} ms since start!`);
*/
now(): number {
- const res = sendSync("op_now") as NowResponse;
+ const res = opNow();
return res.seconds * 1e3 + res.subsecNanos / 1e6;
}
}