diff options
Diffstat (limited to 'tests/specs/bench/finally_timeout/finally_timeout.ts')
-rw-r--r-- | tests/specs/bench/finally_timeout/finally_timeout.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/specs/bench/finally_timeout/finally_timeout.ts b/tests/specs/bench/finally_timeout/finally_timeout.ts new file mode 100644 index 000000000..c49eb8da2 --- /dev/null +++ b/tests/specs/bench/finally_timeout/finally_timeout.ts @@ -0,0 +1,11 @@ +Deno.bench("error", function () { + const timer = setTimeout(() => null, 10000); + try { + throw new Error("fail"); + } finally { + clearTimeout(timer); + } +}); + +Deno.bench("success", function () { +}); |