Skip to content

Commit

Permalink
Fix stats feature on 1.9 and later
Browse files Browse the repository at this point in the history
In v1.9, Base.cumulative_compile_time_ns() was changed to return a tuple of
`(compile_time, recompile_time)`. We now use the sum of the two to show the
total compilation time.
  • Loading branch information
JamesWrigley committed Dec 20, 2023
1 parent 1f5d44a commit 6c7dcbb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/testset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,12 @@ macro stats(yes, ex)
end
end

cumulative_compile_time_ns() =
isdefined(Base, :cumulative_compile_time_ns) ?
@static if VERSION > v"1.9"
cumulative_compile_time_ns() = sum(Base.cumulative_compile_time_ns())
else
cumulative_compile_time_ns() = isdefined(Base, :cumulative_compile_time_ns) ?
Base.cumulative_compile_time_ns() :
UInt(0)
end

end # module

0 comments on commit 6c7dcbb

Please sign in to comment.