包详细信息

timoi

Yet another elapse time library.

elapse, time, timer, benchmark

自述文件

Timoi

Yet another elapse time library.

Installation

 $ npm i timoi

Usage

Log to the console or take timing date for further computation

import timoi from "timoi"

const time = timoi()
doWork()

time()      // console.log(`Took ${x}ms`)
time.time() // x
time.str()  // `${x}ms`

Named scopes

import timoi from "timoi"

const time = timoi("doWork")
doWork()

time()      // console.log(`doWork took ${x}ms`)
doWork()

time()      // console.log(`doWork#2 took ${x}ms`)

Contribute

All feedback is appreciated. Create a pull request or write an issue.