Package Exports
- rdtsc
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rdtsc) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
The most high resolution timing in NodeJs
This module provide function rdtsc() that call C++ function __rdtsc() that call processor command RDTSC (Read Time Stamp Counter)
rdtsc() return counts the number of cycles since computer start
(rdtsc() - rdtsc()) is always < 0
** Tested on Windows **
Example:
import { rdtsc, calcPerformance } from 'rdtsc';
// calcPerformance(func0, func1, testTimeMilliseconds);
// result = <min time of func1> - <min time of func0>;
var result = calcPerformance(
() => {
},
() => {
Object.keys(Math);
},
1000);
console.log('"Object.keys(Math)" time =', result);