# @cniot/profiler

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

Latest version **0.0.3** (published 2021-04-27) · 0 weekly downloads

## Install

```sh
npm install @cniot/profiler
pnpm add @cniot/profiler
yarn add @cniot/profiler
bun add @cniot/profiler
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2021-04-27 |
| First published | 2021-04-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jun.lu |

## Links

- npm: https://www.npmjs.com/package/@cniot/profiler
- npm.io page: https://npm.io/package/@cniot/profiler

## Recent versions

- 0.0.3 (latest) — 2021-04-27

## README

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


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

清理统计数据

---
_Source: https://npm.io/package/@cniot/profiler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
