MCPcopy Index your code
hub / github.com/ampproject/amphtml / timedExecFn

Function timedExecFn

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

* Wraps an exec helper in a timer. Returns the result of the helper. * @param {function(string, string=): ?} execFn * @return {function(string, string=): ?}

(execFn)

Source from the content-addressed store, hash-verified

172 * @return {function(string, string=): ?}
173 */
174function timedExecFn(execFn) {
175 return (cmd, ...rest) => {
176 const startTime = startTimer(cmd);
177 const p = execFn(cmd, ...rest);
178 stopTimer(cmd, startTime);
179 return p;
180 };
181}
182
183/**
184 * Executes the provided command and times it. Errors, if any, are printed.

Callers 1

utils.jsFile · 0.85

Calls 2

startTimerFunction · 0.85
stopTimerFunction · 0.85

Tested by

no test coverage detected