2.0.1-beta.0 • Published 5 years ago

@icon-magic/timing v2.0.1-beta.0

Weekly downloads
2
License
BSD-2-Clause
Repository
-
Last release
5 years ago

@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()