(options, limit)
| 31 | } |
| 32 | |
| 33 | function runMultibar(options, limit){ |
| 34 | // create new progress bar using default values |
| 35 | const multibar = new _progress.MultiBar(options); |
| 36 | |
| 37 | const bar1 = multibar.create(limit, 1); |
| 38 | const bar2 = multibar.create(2124, 541); |
| 39 | |
| 40 | const fibonacciNumbers = []; |
| 41 | |
| 42 | // calculate the Nth fibonacci |
| 43 | // this loop is executed synchronous - no timer/interval callbacks will be executed |
| 44 | for (let i = 1; i <= limit; i++) { |
| 45 | fibonacciNumbers.push(fibonacci(i)); |
| 46 | bar1.update(i); |
| 47 | bar2.increment(89); |
| 48 | |
| 49 | // force redraw |
| 50 | multibar.update(); |
| 51 | } |
| 52 | |
| 53 | // stop all bars |
| 54 | multibar.stop(); |
| 55 | |
| 56 | // display the numbers: |
| 57 | console.log('\nFibonacci (1-', fibonacciNumbers.length,'): ', fibonacciNumbers.join(', '), '\n'); |
| 58 | } |
| 59 | |
| 60 | console.log('\nCalculation without synchronous updates'); |
| 61 | runSinglebar({ |
no test coverage detected
searching dependent graphs…