summaryrefslogtreecommitdiff
path: root/js/performance_test.ts
diff options
context:
space:
mode:
authorDmitry Sharshakov <sh7dm@outlook.com>2019-02-02 09:27:42 +0300
committerRyan Dahl <ry@tinyclouds.org>2019-02-02 01:27:42 -0500
commit16ed1f2545b34851ebdb9095251236fb51e39f5d (patch)
treeef88386129adefaf0ed22f150dff01b1f134563e /js/performance_test.ts
parente5899b14e268b6b636b04b8f5a78df4c23e00478 (diff)
Add performance.now (#1633)
Diffstat (limited to 'js/performance_test.ts')
-rw-r--r--js/performance_test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/performance_test.ts b/js/performance_test.ts
new file mode 100644
index 000000000..154dadbbe
--- /dev/null
+++ b/js/performance_test.ts
@@ -0,0 +1,10 @@
+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
+import { test, assert } from "./test_util.ts";
+
+test(function now() {
+ const start = performance.now();
+ setTimeout(() => {
+ const end = performance.now();
+ assert(end - start >= 10);
+ }, 10);
+});