From 6de59f1908430b5eac48e9f3a74caf6b262221a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szalay=20Krist=C3=B3f?= <32012862+littletof@users.noreply.github.com> Date: Fri, 29 May 2020 08:29:58 +0200 Subject: Return results in benchmark promise (#5842) --- std/testing/bench_example.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'std/testing/bench_example.ts') 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/ }); +} -- cgit v1.2.3