Node.js process.hrtime.bigint() Method
The process.hrtime.bigint() method returns the current high-resolution real-time in nanoseconds as a bigint in NodeJS. It does not support an additional time argument because the difference can be computed directly by subtraction of the two bigints variables.
We used it to calculate the total time in the nanosecond between the process by subtracting the start time and end time.
Parameter: This function does not take any parameter.
Return Type: It returns bigint.
Example 1: Create an index.js file with the following code.
Run the index.js file using the following command:
Start Time: 507990695929600n Execution time will be calculated.... End Time: 1005191900n
Example 2: Create an index.js file with the following code.
Start Time: 507818309465700n Subtraction of two number is : 5 End Time: 1008706600n