measure-time

measure-time is a stopwatch.

Usage no npm install needed!

<script type="module">
  import measureTime from 'https://cdn.skypack.dev/measure-time';
</script>

README

measure-time

measure-time is a stopwatch.

Status

Category Status
Version npm
Dependencies David
Dev dependencies David
Build GitHub Actions
License GitHub

Installation

$ npm install measure-time

Quick start

First you need to add a reference to measure-time to your application.

const { measureTime } = require('measure-time');

If you use TypeScript, use the following code instead:

import { measureTime } from 'measure-time';

Then, call the measureTime function to start measuring time. The function returns another function, getElapsed, that you need to call to get the elapsed time.

const getElapsed = measureTime();

// ...

const elapsed = getElapsed();

console.log(elapsed);
// => {
//      seconds: 3
//      milliseconds: 141,
//      millisecondsTotal: 3141
//    }

Running quality assurance

To run quality assurance for this module use roboter:

$ npx roboter