summaryrefslogtreecommitdiff
path: root/std/testing/bench_example.ts
diff options
context:
space:
mode:
authorSzalay Kristóf <32012862+littletof@users.noreply.github.com>2020-05-29 08:29:58 +0200
committerGitHub <noreply@github.com>2020-05-29 02:29:58 -0400
commit6de59f1908430b5eac48e9f3a74caf6b262221a9 (patch)
tree6f7dba1777b7735e0221aaf1320de412e815c988 /std/testing/bench_example.ts
parentfe7d6824c91b0c2b45c1248fc58847250f6c9f42 (diff)
Return results in benchmark promise (#5842)
Diffstat (limited to 'std/testing/bench_example.ts')
-rw-r--r--std/testing/bench_example.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/std/testing/bench_example.ts b/std/testing/bench_example.ts
index 401516cca..366521f85 100644
--- a/std/testing/bench_example.ts
+++ b/std/testing/bench_example.ts
@@ -1,5 +1,5 @@
// https://deno.land/std/testing/bench.ts
-import { BenchmarkTimer, bench, runIfMain } from "./bench.ts";
+import { BenchmarkTimer, bench, runBenchmarks } from "./bench.ts";
// Basic
bench(function forIncrementX1e9(b: BenchmarkTimer): void {
@@ -26,4 +26,6 @@ bench(function throwing(b): void {
});
// Bench control
-runIfMain(import.meta, { skip: /throw/ });
+if (import.meta.main) {
+ runBenchmarks({ skip: /throw/ });
+}