Skip to content

Commit 8d37cf6

Browse files
committed
improve benchmark docs
1 parent 171ce9c commit 8d37cf6

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Returns a new _Array_ or _String_ after inserting and flatten `value` at `index`.
55

66
## Get Started
7-
```bash
7+
```shell
88
npm install flat-insert
99
```
1010

@@ -32,10 +32,17 @@ insert('123', 'yo', 2)
3232
```
3333

3434
## Benchmark
35-
```bash
36-
string insert x 11,097,858 ops/sec ±0.70% (84 runs sampled)
37-
array insert x 1,015,198 ops/sec ±0.97% (86 runs sampled)
38-
array insert multi x 1,839,994 ops/sec ±0.87% (83 runs sampled)
35+
```shell
36+
node benchmark.js
37+
```
38+
### Results
39+
```javascript
40+
insert(string, 'foo', 3)
41+
// → 11,097,858 ops/sec ±0.70% (84 runs sampled)
42+
insert(array, 'foo', 3)
43+
// → 1,015,198 ops/sec ±0.97% (86 runs sampled)
44+
insert(array, ['foo', undefined, true], 3)
45+
// → 1,839,994 ops/sec ±0.87% (83 runs sampled)
3946
```
4047

4148
## License

0 commit comments

Comments
 (0)