Skip to content

Commit

Permalink
Don't show timing on error for clearer error output
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Feb 11, 2023
1 parent 2cf593d commit bc4e585
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
15 changes: 7 additions & 8 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 end = performance.now()
const duration = (end - start) / 1000.0
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
}
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) {
Expand Down
15 changes: 7 additions & 8 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc4e585

Please sign in to comment.