Don't show timing on error for clearer error output

This commit is contained in:
Benoit Daloze
2023-02-11 13:48:39 +01:00
parent 2cf593d66b
commit bc4e585e26
2 changed files with 14 additions and 16 deletions
+4 -5
View File
@@ -47,17 +47,16 @@ export async function measure(name, block) {
}
}
// Same as mesaure() but without the group
// Same as mesaure() but without the group, and no time shown on error
export async function time(name, block) {
console.log(`> ${name}`)
const start = performance.now()
try {
return await block()
} finally {
const value = await block()
const end = performance.now()
const duration = (end - start) / 1000.0
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
}
return value
}
export function isHeadVersion(rubyVersion) {
Generated Vendored
+4 -5
View File
@@ -349,17 +349,16 @@ async function measure(name, block) {
}
}
// Same as mesaure() but without the group
// Same as mesaure() but without the group, and no time shown on error
async function time(name, block) {
console.log(`> ${name}`)
const start = performance.now()
try {
return await block()
} finally {
const value = await block()
const end = performance.now()
const duration = (end - start) / 1000.0
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
}
return value
}
function isHeadVersion(rubyVersion) {