({ n, args })
| 11 | const gargs = [1, 2, 3]; |
| 12 | |
| 13 | function main({ n, args }) { |
| 14 | const myArguments = gargs.slice(0, args); |
| 15 | bench.start(); |
| 16 | |
| 17 | bdomain.enter(); |
| 18 | for (let i = 0; i < n; i++) { |
| 19 | if (myArguments.length >= 2) { |
| 20 | const args = Array.prototype.slice.call(myArguments, 1); |
| 21 | fn.apply(this, args); |
| 22 | } else { |
| 23 | fn.call(this); |
| 24 | } |
| 25 | } |
| 26 | bdomain.exit(); |
| 27 | |
| 28 | bench.end(n); |
| 29 | } |
| 30 | |
| 31 | function fn(a = 1, b = 2, c = 3) { |
| 32 | return a + b + c; |