@icon-magic/timing
v2.0.1-beta.0
Published
Icon magic timing package.
Downloads
3
Keywords
Readme
@icon-magic/timing
This package handles timing using Node.js' process.hrtime function.
Usage
// Import the timing module module
import { timer } from '@icon-magic/timing';
const TIMER = timer();
function doSomething() {
TIMER.start();
/* Something is getting done */
LOGGER.info(`${TIMER.end()}`);
}
Methods
The timer
object has the following methods:
To start the timer:
- start()
To end the timer, returns elapsed time:
- end()