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

Function endBuildStep

build-system/tasks/helpers.js:570–585  ·  view source on GitHub ↗

* Stops the timer for the given build step and prints the execution time. * @param {string} stepName Name of the action, like 'Compiled' or 'Minified' * @param {string} targetName Name of the target, like a filename or path * @param {DOMHighResTimeStamp} startTime Start time of build step

(stepName, targetName, startTime)

Source from the content-addressed store, hash-verified

568 * @param {DOMHighResTimeStamp} startTime Start time of build step
569 */
570function endBuildStep(stepName, targetName, startTime) {
571 const endTime = Date.now();
572 const executionTime = new Date(endTime - startTime);
573 const mins = executionTime.getMinutes();
574 const secs = executionTime.getSeconds();
575 const ms = ('000' + executionTime.getMilliseconds().toString()).slice(-3);
576 let timeString = '(';
577 if (mins > 0) {
578 timeString += mins + ' m ' + secs + '.' + ms + ' s)';
579 } else if (secs === 0) {
580 timeString += ms + ' ms)';
581 } else {
582 timeString += secs + '.' + ms + ' s)';
583 }
584 log(stepName, cyan(targetName), green(timeString));
585}
586
587/**
588 * Prints a helpful message that lets the developer know how to switch configs.

Callers 14

buildCompilerFunction · 0.85
copyParsersFunction · 0.85
buildExtensionsFunction · 0.85
copyWorkerDomResourcesFunction · 0.85
compileAllJsFunction · 0.85
finishBundleFunction · 0.85
analyticsVendorConfigsFunction · 0.85
buildVendorConfigsFunction · 0.85
copyCssFunction · 0.85
compileCssFunction · 0.85

Calls 6

cyanFunction · 0.85
greenFunction · 0.85
nowMethod · 0.80
getSecondsMethod · 0.80
logFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected