cblanc / stopwatch

0 wth/min timing api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stopwatch

CircleCI Coverage Status

A timing API that fits in my head

npm install @cablanchard/stopwatch

Use

const { Stopwatch } = require("@cablanchard/stopwatch");

const stopwatch = Stopwatch.start(); // Start the stopwatch

const result = await doSomething();

// Get the amount of time transpired
stopwatch.split() // => 103.2312 ms
stopwatch.split("s") // => 0.1812 s (seconds)
stopwatch.split("ms") // => 308.2322 ms (milliseconds)
stopwatch.split("ns") // => 490000000 ns (nanoseconds)

License

MIT

About

0 wth/min timing api


Languages

Language:TypeScript 100.0%