Skip to content

Commit

Permalink
Print elapsed time for each folded log header
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed May 29, 2024
1 parent 36c07bc commit 61900d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32484,8 +32484,8 @@ async function run() {
(0, import_core3.info)(`Wait ${readableDuration(msec)} before next polling to reduce API calls.`);
await wait(msec);
}
(0, import_core3.startGroup)(`Polling ${attempts}: ${(/* @__PURE__ */ new Date()).toISOString()}`);
const elapsed = mr.Duration.from({ milliseconds: Math.ceil(performance.now() - startedAt) });
(0, import_core3.startGroup)(`Polling ${attempts}: ${(/* @__PURE__ */ new Date()).toISOString()} => ${elapsed.toString()}`);
const checks = await fetchChecks(githubToken, trigger);
if ((0, import_core3.isDebug)()) {
(0, import_core3.debug)(JSON.stringify({ label: "rawdata", checks, elapsed }, null, 2));
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ async function run(): Promise<void> {
await wait(msec);
}

startGroup(`Polling ${attempts}: ${(new Date()).toISOString()}`);
// Put getting elapsed time before of fetchChecks to keep accuracy of the purpose
const elapsed = Temporal.Duration.from({ milliseconds: Math.ceil(performance.now() - startedAt) });
startGroup(`Polling ${attempts}: ${(new Date()).toISOString()} => ${elapsed.toString()}`);
const checks = await fetchChecks(githubToken, trigger);
if (isDebug()) {
debug(JSON.stringify({ label: 'rawdata', checks, elapsed }, null, 2));
Expand Down

0 comments on commit 61900d1

Please sign in to comment.