@cniot/profiler

0.0.3 • Public • Published

用于记录程序的运行性能。

example

profiler.startTracing("SETTIMEOUT");
profiler.startTracing("DEFAULT");
setTimeout(() => {
  profiler.stopTracing();
  profiler.print();
  // SETTIMEOUT       1601359696951   1601359699953   3002
  // DEFAULT          1601359696951   1601359696952   1
}, 3000);
profiler.stopTracing();

API

  • startTracing(String)

记录开始时间,任意填写一个字符串标记符

  • stopTracing()

结束记录。startTracing,stopTracing 必须成对出现

  • exports()

导出数据

  • print()

使用 console.log 在控制台打印数据

  • clear()

清理统计数据

Readme

Keywords

none

Package Sidebar

Install

npm i @cniot/profiler

Weekly Downloads

1

Version

0.0.3

License

none

Unpacked Size

9.08 kB

Total Files

7

Last publish

Collaborators

  • hxuena
  • lanjian.yj
  • qige.yzx
  • mingnan.wmn
  • xiaobc
  • wangyuhao.wyh
  • rio7
  • wukidy
  • jun.lu
  • zhouhuan