Skip to content

Commit b6c073a

Browse files
committed
Fix stats feature on 1.9 and later
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.
1 parent 1f5d44a commit b6c073a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/testset.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,13 @@ macro stats(yes, ex)
672672
end
673673
end
674674

675-
cumulative_compile_time_ns() =
676-
isdefined(Base, :cumulative_compile_time_ns) ?
675+
@static if VERSION >= v"1.9"
676+
# In 1.9 this function was changed to return a tuple of (compile_time, recompilation_time)
677+
cumulative_compile_time_ns() = sum(Base.cumulative_compile_time_ns())
678+
else
679+
cumulative_compile_time_ns() = isdefined(Base, :cumulative_compile_time_ns) ?
677680
Base.cumulative_compile_time_ns() :
678681
UInt(0)
682+
end
679683

680684
end # module

0 commit comments

Comments
 (0)