MCPcopy Create free account
hub / github.com/github/gh-aw / formatDuration

Function formatDuration

actions/setup/js/process_runner.cjs:24–32  ·  view source on GitHub ↗

* Format elapsed milliseconds as a human-readable string (e.g. "3m 12s"). * @param {number} ms * @returns {string}

(ms)

Source from the content-addressed store, hash-verified

22 * @returns {string}
23 */
24function formatDuration(ms) {
25 const totalSeconds = Math.floor(ms / 1000);
26 const minutes = Math.floor(totalSeconds / 60);
27 const seconds = totalSeconds % 60;
28 if (minutes > 0) {
29 return `${minutes}m ${seconds}s`;
30 }
31 return `${seconds}s`;
32}
33
34/**
35 * Sleep for a specified duration.

Callers 9

runProcessFunction · 0.70
formatToolUseFunction · 0.70
appendStatisticsFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected