MCPcopy
hub / github.com/ampproject/amphtml / startTimer

Function startTimer

build-system/pr-check/utils.js:128–137  ·  view source on GitHub ↗

* Starts a timer to measure the execution time of the given job / command. * @param {string} jobNameOrCmd * @return {DOMHighResTimeStamp}

(jobNameOrCmd)

Source from the content-addressed store, hash-verified

126 * @return {DOMHighResTimeStamp}
127 */
128function startTimer(jobNameOrCmd) {
129 const startTime = Date.now();
130 const loggingPrefix = getLoggingPrefix();
131 logWithoutTimestamp(
132 '\n' + loggingPrefix,
133 'Running',
134 cyan(jobNameOrCmd) + '...'
135 );
136 return startTime;
137}
138
139/**
140 * Stops the timer for the given job / command and prints the execution time.

Callers 5

runReleaseJobFunction · 0.85
runCiJobFunction · 0.85
timedExecFnFunction · 0.85
prCheckFunction · 0.85
initMethod · 0.85

Calls 4

getLoggingPrefixFunction · 0.85
logWithoutTimestampFunction · 0.85
cyanFunction · 0.85
nowMethod · 0.80

Tested by

no test coverage detected