Skip to content

Commit bc4e585

Browse files
committed
Don't show timing on error for clearer error output
1 parent 2cf593d commit bc4e585

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

common.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,16 @@ export async function measure(name, block) {
4747
}
4848
}
4949

50-
// Same as mesaure() but without the group
50+
// Same as mesaure() but without the group, and no time shown on error
5151
export async function time(name, block) {
5252
console.log(`> ${name}`)
5353
const start = performance.now()
54-
try {
55-
return await block()
56-
} finally {
57-
const end = performance.now()
58-
const duration = (end - start) / 1000.0
59-
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
60-
}
54+
const value = await block()
55+
const end = performance.now()
56+
57+
const duration = (end - start) / 1000.0
58+
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
59+
return value
6160
}
6261

6362
export function isHeadVersion(rubyVersion) {

dist/index.js

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)