Don't show timing on error for clearer error output
This commit is contained in:
@@ -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) {
|
export async function time(name, block) {
|
||||||
console.log(`> ${name}`)
|
console.log(`> ${name}`)
|
||||||
const start = performance.now()
|
const start = performance.now()
|
||||||
try {
|
const value = await block()
|
||||||
return await block()
|
const end = performance.now()
|
||||||
} finally {
|
|
||||||
const end = performance.now()
|
const duration = (end - start) / 1000.0
|
||||||
const duration = (end - start) / 1000.0
|
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
|
||||||
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
|
return value
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isHeadVersion(rubyVersion) {
|
export function isHeadVersion(rubyVersion) {
|
||||||
|
|||||||
+7
-8
@@ -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) {
|
async function time(name, block) {
|
||||||
console.log(`> ${name}`)
|
console.log(`> ${name}`)
|
||||||
const start = performance.now()
|
const start = performance.now()
|
||||||
try {
|
const value = await block()
|
||||||
return await block()
|
const end = performance.now()
|
||||||
} finally {
|
|
||||||
const end = performance.now()
|
const duration = (end - start) / 1000.0
|
||||||
const duration = (end - start) / 1000.0
|
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
|
||||||
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
|
return value
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isHeadVersion(rubyVersion) {
|
function isHeadVersion(rubyVersion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user