MCPcopy Index your code
hub / github.com/nodejs/node / timeLogImpl

Function timeLogImpl

lib/internal/util/debuglog.js:204–221  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

202 * @returns {void}
203 */
204function 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

Callers 2

timeEndFunction · 0.70
timeLogFunction · 0.70

Calls 2

formatTimeFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…