instant-rs
一个比 console.time 更好的耗时度量工具,提供更友好的时间格式显示,采用 Rust API 设计,并解决了 console.time 需要重复写 label 的问题。
一个比 console.time 更好的耗时度量工具,提供更友好的时间格式显示,采用 Rust API 设计,并解决了 console.time 需要重复写 label 的问题。
console.time
比 console.time 更好的耗时度量工具,将耗时转成可读性更好的格式,采用 Rust API 设计,同时解决 console.time label 需要写两次问题。## 效果`1337000000ms => '15d 11h 23m 20s'````jsimport Instant from 'instant-rs'const now = Instant.now();// 执行耗时操作await doSthExpensive()console.log("time costs", now.elapsed());```## 项目链接https://www.npmjs.com/package/instant-rs