summaryrefslogtreecommitdiff
path: root/tests/testdata/bench/finally_timeout.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testdata/bench/finally_timeout.ts')
-rw-r--r--tests/testdata/bench/finally_timeout.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/testdata/bench/finally_timeout.ts b/tests/testdata/bench/finally_timeout.ts
new file mode 100644
index 000000000..c49eb8da2
--- /dev/null
+++ b/tests/testdata/bench/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 () {
+});