X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=promise-handling.mjs;h=7f450b3fc53c58f3e93abd821b6490ba7519d260;hb=3d3820c6d32315be92b08f19b905b352dad8506d;hp=97117f19d9a086733a9bad0b0d32d9097e850be9;hpb=4247cbbd3c312d34802d06ca303be866cbc987ad;p=benchmarks-js.git diff --git a/promise-handling.mjs b/promise-handling.mjs index 97117f1..7f450b3 100644 --- a/promise-handling.mjs +++ b/promise-handling.mjs @@ -3,19 +3,12 @@ import Benchmark from 'benny' /** * */ -async function promise () { - return await new Promise(resolve => { +async function asyncFunction () { + await new Promise(resolve => { resolve() }) } -/** - * - */ -async function asyncFunction () { - return await promise() -} - Benchmark.suite( 'Promise handling', Benchmark.add('await promise', async () => {