Socket
Socket
Sign inDemoInstall

@cniot/profiler

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @cniot/profiler

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


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

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()

清理统计数据

FAQs

Last updated on 27 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc