* Stops the timer for the given job / command and prints the execution time. * @param {string} jobNameOrCmd * @param {DOMHighResTimeStamp} startTime
(jobNameOrCmd, startTime)
| 142 | * @param {DOMHighResTimeStamp} startTime |
| 143 | */ |
| 144 | function stopTimer(jobNameOrCmd, startTime) { |
| 145 | const endTime = Date.now(); |
| 146 | const executionTime = endTime - startTime; |
| 147 | const mins = Math.floor(executionTime / 60000); |
| 148 | const secs = Math.floor((executionTime % 60000) / 1000); |
| 149 | const loggingPrefix = getLoggingPrefix(); |
| 150 | logWithoutTimestamp( |
| 151 | loggingPrefix, |
| 152 | 'Done running', |
| 153 | cyan(jobNameOrCmd), |
| 154 | 'Total time:', |
| 155 | green(mins + 'm ' + secs + 's') |
| 156 | ); |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Aborts the process after stopping the timer for a given job |
no test coverage detected