n-elapsed-time
v1.0.0
Published
log the elapsed time of your code running
Downloads
7
Maintainers
Readme
n-elapsed-time
About
log the elapsed time of your code running
NOTE: typescript supports
Installation
npm install n-elapsed-time
yarn add n-elapsed-time
pnpm add n-elapsed-time
Usage
import {ElapsedTime} from 'n-elapsed-time'
const timer = new ElapsedTime()
timer.start()
// ...code block
timer.end()
console.log(timer.ns())
console.log(timer.ms())
console.log(timer.s(false)) // if false, the time unit would be not showed
=>
809070600n
809.071ms
0.809071