summaryrefslogtreecommitdiff
path: root/cli/js/performance_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/performance_test.ts')
-rw-r--r--cli/js/performance_test.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/js/performance_test.ts b/cli/js/performance_test.ts
index 7e7f63d8c..227514954 100644
--- a/cli/js/performance_test.ts
+++ b/cli/js/performance_test.ts
@@ -1,10 +1,13 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import { testPerm, assert } from "./test_util.ts";
+import { testPerm, assert, createResolvable } from "./test_util.ts";
-testPerm({ hrtime: false }, function now(): void {
+testPerm({ hrtime: false }, async function performanceNow(): Promise<void> {
+ const resolvable = createResolvable();
const start = performance.now();
setTimeout((): void => {
const end = performance.now();
assert(end - start >= 10);
+ resolvable.resolve();
}, 10);
+ await resolvable;
});