Skip to content

Commit

Permalink
Fix logging of query durations, which were off by 10x for µs precision (
Browse files Browse the repository at this point in the history
#506)

Nicely improves timestamp accuracy
  • Loading branch information
mloughran authored Dec 13, 2024
1 parent 6e14d8e commit ecae4d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/adapter/base.cr
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ abstract class Granite::Adapter::Base
elsif elapsed_time > 0.001
"#{(elapsed_time * 1_000).trunc}ms".colorize.yellow
elsif elapsed_time > 0.000_001
"#{(elapsed_time * 100_000).trunc}µs".colorize.green
"#{(elapsed_time * 1_000_000).trunc}µs".colorize.green
elsif elapsed_time > 0.000_000_001
"#{(elapsed_time * 1_000_000_000).trunc}ns".colorize.green
else
Expand Down

0 comments on commit ecae4d7

Please sign in to comment.