Skip to content

Commit

Permalink
Standalone: print test run start/end time to console
Browse files Browse the repository at this point in the history
Helpful for measuring test runtime broadly when looking for optimizations.
  • Loading branch information
kainino0x committed Aug 8, 2023
1 parent 791dd28 commit 61b0152
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common/runtime/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,14 @@ function makeTreeNodeHeaderHTML(
.addClass(isLeaf ? 'leafrun' : 'subtreerun')
.attr('alt', runtext)
.attr('title', runtext)
.on('click', () => void runSubtree())
.on('click', async () => {
console.log(`Starting run for ${n.query}`);
const startTime = performance.now();
await runSubtree();
const dt = performance.now() - startTime;
const dtMinutes = (dt / 1000 / 60);
console.log(`Finished run: ${dt.toFixed(1)} ms = ${dtMinutes.toFixed(1)} min`);
})
.appendTo(header);
$('<a>')
.addClass('nodelink')
Expand Down

0 comments on commit 61b0152

Please sign in to comment.