Commit | Line | Data |
---|---|---|
f522d7b9 | 1 | import Benchmark from 'benny' |
adad2e80 JB |
2 | |
3 | Benchmark.suite( | |
4 | 'Is undefined', | |
5 | Benchmark.add('=== undefined', (value = undefined) => { | |
6 | return value === undefined | |
7 | }), | |
8 | Benchmark.add("typeof === 'undefined'", (value = undefined) => { | |
9 | return typeof value === 'undefined' | |
10 | }), | |
11 | Benchmark.cycle(), | |
12 | Benchmark.complete(), | |
13 | Benchmark.save({ | |
14 | file: 'is-undefined', | |
15 | format: 'json', | |
16 | details: true | |
17 | }), | |
18 | Benchmark.save({ | |
19 | file: 'is-undefined', | |
20 | format: 'chart.html', | |
21 | details: true | |
22 | }), | |
23 | Benchmark.save({ | |
24 | file: 'is-undefined', | |
25 | format: 'table.html', | |
26 | details: true | |
27 | }) | |
48f5216d | 28 | ).catch((err) => { |
4b16770a JB |
29 | console.error(err) |
30 | }) |