https://github.com/jchip/node-bench
node.js benchmark
https://github.com/jchip/node-bench
Last synced: over 1 year ago
JSON representation
node.js benchmark
- Host: GitHub
- URL: https://github.com/jchip/node-bench
- Owner: jchip
- Created: 2020-08-21T09:32:18.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2020-08-21T09:53:05.000Z (almost 6 years ago)
- Last Synced: 2025-02-20T10:37:18.665Z (over 1 year ago)
- Language: TypeScript
- Size: 68.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-bench
node.js benchmark
API reference:
```js
import { Suite } from "@jchip/bench";
const suite = new Suite();
await suite
.add("test 1", async () => {
return Promise.resolve(1);
})
.add("test 2", async () => {
return Promise.resolve(2);
})
.on("cycle", ({ result }) => {
console.log(result);
})
.on("complete", results => {
console.log(results);
})
.run();
```