Skip to content

Instantly share code, notes, and snippets.

@samuelcarreira
samuelcarreira / benchmark-processHrtime-vs-dateNow.js
Created March 21, 2020 01:20
Benchmark time subtraction: process.hrtime; process.hrtime.bigint(); Date.now()
/**
* I know that the process.hrtime as a higher precision over the
* Date constructor object so it's not a "fair" benchmark,
* but if you doesn't need a high precision timer and you just want
* to compare the fastest time subtraction this benchmark can
* be usefull
*
* Licensed under MIT
* Copyright (c) 2020 [Samuel Carreira]
*/