Commit | Line | Data |
---|---|---|
1 | const start = Date.now() | |
2 | const toBench = () => { | |
3 | const iterations = 10000 | |
4 | ||
5 | for (let i = 0; i <= iterations; i++) { | |
6 | const o = { | |
7 | a: i | |
8 | } | |
9 | JSON.stringify(o) | |
10 | } | |
11 | } | |
12 | ||
13 | for (let i = 0; i < 1000; i++) { | |
14 | toBench() | |
15 | } | |
16 | console.log('Time take is ' + (Date.now() - start)) |