Skip to content

Commit

Permalink
fix comma logic in time_print (#55977)
Browse files Browse the repository at this point in the history
Minor formatting fix
  • Loading branch information
IanButterworth authored Oct 3, 2024
1 parent 6b9719f commit 42737f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/timing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function time_print(io::IO, elapsedtime, bytes=0, gctime=0, allocs=0, lock_confl
print(io, length(timestr) < 10 ? (" "^(10 - length(timestr))) : "")
end
print(io, timestr, " seconds")
parens = bytes != 0 || allocs != 0 || gctime > 0 || compile_time > 0
parens = bytes != 0 || allocs != 0 || gctime > 0 || compile_time > 0 || lock_conflicts > 0
parens && print(io, " (")
if bytes != 0 || allocs != 0
allocs, ma = prettyprint_getunits(allocs, length(_cnt_units), Int64(1000))
Expand All @@ -228,7 +228,7 @@ function time_print(io::IO, elapsedtime, bytes=0, gctime=0, allocs=0, lock_confl
print(io, ", ", lock_conflicts, " lock conflict$plural")
end
if compile_time > 0
if bytes != 0 || allocs != 0 || gctime > 0
if bytes != 0 || allocs != 0 || gctime > 0 || lock_conflicts > 0
print(io, ", ")
end
print(io, Ryu.writefixed(Float64(100*compile_time/elapsedtime), 2), "% compilation time")
Expand Down

0 comments on commit 42737f7

Please sign in to comment.