DEV Community

Discussion on: Measure time with a higher order utility function

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

You should also consider using performance.now().

Collapse
 
apisurfer profile image
Luka Vidaković

Hey, thanks for mentioning this! I haven't had a clue that this API exists. I mostly use the proposed function in Nodejs, but this will come in handy on the client side :)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

For Node.js, it is inside perf_hooks.

I have wrote js-benchmark some time ago, that works in both Node.js and browsers.

Thread Thread
 
apisurfer profile image
Luka Vidaković

Seems like it's time to brush up on my knowledge of the existing browser and node APIs 😅