* Returns true if label was found * @param {string} timesStore * @param {string} implementation * @param {LogImpl} logImp * @param {string} label * @param {any} args * @returns {void}
(timesStore, implementation, logImp, label, args)
| 202 | * @returns {void} |
| 203 | */ |
| 204 | function timeLogImpl(timesStore, implementation, logImp, label, args) { |
| 205 | const time = timesStore.get(label); |
| 206 | if (time === undefined) { |
| 207 | process.emitWarning(`No such label '${label}' for ${implementation}`); |
| 208 | return; |
| 209 | } |
| 210 | |
| 211 | const duration = process.hrtime(time); |
| 212 | const ms = duration[0] * 1000 + duration[1] / 1e6; |
| 213 | |
| 214 | const formatted = formatTime(ms); |
| 215 | |
| 216 | if (args === undefined) { |
| 217 | logImp(label, formatted); |
| 218 | } else { |
| 219 | logImp(label, formatted, args); |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | /** |
| 224 | * @param {SafeMap} timesStore |
no test coverage detected
searching dependent graphs…