4.0.3 • Published 7 months ago

precise v4.0.3

Weekly downloads
112
License
BSD-3-Clause
Repository
github
Last release
7 months ago

precise

Nanosecond timer for node.js

Using the factory

import {precise} from "precise";
const timer = precise().start();
setTimeout(() => console.log(timer.stop().diff()), 1000);

Using the Class

import {Precise} from "precise";
const timer = new Precise().start();
setTimeout(() => console.log(timer.stop().diff()), 1000);
import {Precise} from "precise";
class MyTimer extends Precise {}

Testing

Precise has 100% code coverage with its tests.

-------------|---------|----------|---------|---------|-------------------
File         | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------|---------|----------|---------|---------|-------------------
All files    |     100 |      100 |     100 |     100 |                  
 precise.cjs |     100 |      100 |     100 |     100 |                  
-------------|---------|----------|---------|---------|-------------------

API

diff(ms = false)

Returns the time delta between start() & stop(); setting optional parameter to true will return the delta as milliseconds

reset()

Reset a timer

start()

Starts a timer

stop()

Stops a timer

License

Copyright (c) 2023 Jason Mulligan Licensed under the BSD-3 license

3.0.0

7 months ago

4.0.1

7 months ago

4.0.0

7 months ago

4.0.3

7 months ago

4.0.2

7 months ago

2.0.1

1 year ago

2.0.0

2 years ago

1.1.0

9 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.0

10 years ago