stasadance / hrtime-test

Testing the precision of process.hrtime() inside of an infinite while loop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hrtime-test

This repo tests the nanosecond precision of process.hrtime() inside of an infinite while loop.
There is a noticeable delta (~0.2 ms) per loop caused by calculations and logging to the console.
The delay depends on your CPU speed, the example below was done on a Ryzen 9 3900X.

Example

Example

Usage

Make sure you have node.js installed on your system.
Clone the repository and run this command inside the project folder.

npm start

About

Testing the precision of process.hrtime() inside of an infinite while loop

License:MIT License


Languages

Language:JavaScript 100.0%