| 24 | nextRun(); |
| 25 | |
| 26 | function nextRun() { |
| 27 | const start = performance.now(); |
| 28 | |
| 29 | less.parse(data, { filename: file, paths: [path.dirname(file)] }, function(err, root, imports, options) { |
| 30 | if (err) { |
| 31 | console.log(err); |
| 32 | process.exit(3); |
| 33 | } |
| 34 | const parserEnd = performance.now(); |
| 35 | |
| 36 | const tree = new less.ParseTree(root, imports); |
| 37 | tree.toCSS(options); |
| 38 | |
| 39 | const renderEnd = performance.now(); |
| 40 | |
| 41 | renderBenchmark.push(renderEnd - start); |
| 42 | parserBenchmark.push(parserEnd - start); |
| 43 | evalBenchmark.push(renderEnd - parserEnd); |
| 44 | |
| 45 | i += 1; |
| 46 | if (i < totalruns) { |
| 47 | nextRun(); |
| 48 | } |
| 49 | else { |
| 50 | finish(); |
| 51 | } |
| 52 | }); |
| 53 | } |
| 54 | |
| 55 | function finish() { |
| 56 | function analyze(benchmark, benchMarkData) { |