Skip to content
This repository was archived by the owner on Dec 17, 2022. It is now read-only.
/ hrtime-test Public archive

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

License

Notifications You must be signed in to change notification settings

stasadance/hrtime-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks