Return results in benchmark promise (#5842)

This commit is contained in:
Szalay Kristóf 2020-05-29 08:29:58 +02:00 committed by GitHub
parent fe7d6824c9
commit 6de59f1908
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 199 additions and 53 deletions

View file

@ -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/ });
}