@icon-magic/timing

Icon magic timing package.

Usage no npm install needed!

<script type="module">
  import iconMagicTiming from 'https://cdn.skypack.dev/@icon-magic/timing';
</script>

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