(size)
| 9 | const a = []; |
| 10 | |
| 11 | function test(size) { |
| 12 | return function() { |
| 13 | console.log(`Write: ${size}`); |
| 14 | const text = utils.randomName(size); |
| 15 | const sb = new StringBuf({size: SIZE + 10}); |
| 16 | const sw = new HrStopwatch(); |
| 17 | sw.start(); |
| 18 | while (sb.length < SIZE) { |
| 19 | sb.addText(text); |
| 20 | } |
| 21 | sw.stop(); |
| 22 | a.push(`${size}:${Math.round(sw.span * 1000)}`); |
| 23 | }; |
| 24 | } |
| 25 | |
| 26 | return Promise.resolve() |
| 27 | .then(test(1)) |