* Stops the timer for the given build step and prints the execution time. * @param {string} stepName Name of the action, like 'Compiled' or 'Minified' * @param {string} targetName Name of the target, like a filename or path * @param {DOMHighResTimeStamp} startTime Start time of build step
(stepName, targetName, startTime)
| 568 | * @param {DOMHighResTimeStamp} startTime Start time of build step |
| 569 | */ |
| 570 | function endBuildStep(stepName, targetName, startTime) { |
| 571 | const endTime = Date.now(); |
| 572 | const executionTime = new Date(endTime - startTime); |
| 573 | const mins = executionTime.getMinutes(); |
| 574 | const secs = executionTime.getSeconds(); |
| 575 | const ms = ('000' + executionTime.getMilliseconds().toString()).slice(-3); |
| 576 | let timeString = '('; |
| 577 | if (mins > 0) { |
| 578 | timeString += mins + ' m ' + secs + '.' + ms + ' s)'; |
| 579 | } else if (secs === 0) { |
| 580 | timeString += ms + ' ms)'; |
| 581 | } else { |
| 582 | timeString += secs + '.' + ms + ' s)'; |
| 583 | } |
| 584 | log(stepName, cyan(targetName), green(timeString)); |
| 585 | } |
| 586 | |
| 587 | /** |
| 588 | * Prints a helpful message that lets the developer know how to switch configs. |
no test coverage detected