https://github.com/ospoon/benchmark-javascript
https://github.com/ospoon/benchmark-javascript
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ospoon/benchmark-javascript
- Owner: OSpoon
- Created: 2022-03-11T09:48:06.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-11T09:55:44.000Z (about 4 years ago)
- Last Synced: 2025-07-10T20:46:49.065Z (11 months ago)
- Language: JavaScript
- Size: 97.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## BenchmarkJavascript
> 使用Benchmarkjs来做代码性能分析。
### feature:
1. 对监听部分做了包装;
2. 对输出部分做了终端表格展示;
3. Case编写提到单独文件编写;
### use:
1. 安装依赖:```npm install```;
2. 运行Test:```npm run test```
3. 输出结果:

### code simple:
```JavaScript
require("../src")
.cases([
{
"RegExp#test": function () {
/o/.test("Hello World!");
},
},
{
"String#indexOf": function () {
"Hello World!".indexOf("o") > -1;
},
},
{
"String#match": function () {
!!"Hello World!".match(/o/);
},
},
])
.run({ async: true });
```