This commit is contained in:
Tutur33
2023-11-24 22:35:41 +01:00
parent 3c0b507a93
commit 7644b2a0f7
45165 changed files with 4803356 additions and 3 deletions
+50
View File
@@ -0,0 +1,50 @@
# time-span [![Build Status](https://travis-ci.org/sindresorhus/time-span.svg?branch=master)](https://travis-ci.org/sindresorhus/time-span)
> Simplified high resolution timing
## Install
```
$ npm install time-span
```
## Usage
```js
const timeSpan = require('time-span');
const end = timeSpan();
timeConsumingFn();
console.log(end());
//=> 1745.3186
console.log(end.rounded());
//=> 1745
console.log(end.seconds());
//=> 1.7453186
```
## API
### `const end = timeSpan()`
Returns a function, that when called, returns the time difference.
#### end()
Elapsed milliseconds.
#### end.rounded()
Elapsed milliseconds rounded.
#### end.seconds()
Elapsed seconds.
#### end.nanoseconds()
Elapsed nanoseconds.