measure-time

measure-time is a stopwatch.

MIT 19 个版本
安装
npm install measure-time
yarn add measure-time
pnpm add measure-time
bun add measure-time
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
版本列表
5.0.8 2022-03-25
5.0.7 2021-08-16
5.0.6 2021-06-10
5.0.5 2021-06-08
5.0.4 2021-06-08
5.0.3 2021-05-10
5.0.2 2021-03-25
5.0.1 2020-11-03
5.0.0 2019-11-15
4.0.0 2019-10-11
3.1.1 2018-02-08
3.1.0 2016-12-01
3.0.0 2016-06-04
2.0.0 2016-03-22
0.0.3 2014-08-24
0.0.2 2014-08-24
0.0.1 2014-08-20
0.0.1-security 2016-03-23
0.0.0 2014-08-20