summaryrefslogtreecommitdiff
path: root/testing/bench_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'testing/bench_test.ts')
-rw-r--r--testing/bench_test.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/testing/bench_test.ts b/testing/bench_test.ts
index 345f104a6..8042db480 100644
--- a/testing/bench_test.ts
+++ b/testing/bench_test.ts
@@ -19,7 +19,8 @@ test(async function benching() {
bench(async function forAwaitFetchDenolandX10(b) {
b.start();
for (let i = 0; i < 10; i++) {
- await fetch("https://deno.land/");
+ let r = await fetch("https://deno.land/");
+ await r.text();
}
b.stop();
});
@@ -27,7 +28,12 @@ test(async function benching() {
bench(async function promiseAllFetchDenolandX10(b) {
const urls = new Array(10).fill("https://deno.land/");
b.start();
- await Promise.all(urls.map((denoland: string) => fetch(denoland)));
+ await Promise.all(
+ urls.map(async (denoland: string) => {
+ let r = await fetch(denoland);
+ await r.text();
+ })
+ );
b.stop();
});