X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=promise-handling.mjs;h=7f450b3fc53c58f3e93abd821b6490ba7519d260;hb=d7ca81e0be8c71539fadaf953e24f37ca68ac39f;hp=b3b02107c9cfc793a7c3149db013236df206b8bb;hpb=f913c68ce1ad111704f1f319706cb99e9659e236;p=benchmarks-js.git diff --git a/promise-handling.mjs b/promise-handling.mjs index b3b0210..7f450b3 100644 --- a/promise-handling.mjs +++ b/promise-handling.mjs @@ -3,19 +3,12 @@ import Benchmark from 'benny' /** * */ -function promise () { - return 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 () => {