Skip to content

Commit

Permalink
Add process_cumulative_compile_time_ns() - returns total compilation
Browse files Browse the repository at this point in the history
time across all threads.
  • Loading branch information
NHDaly committed Jul 30, 2021
1 parent a5a5111 commit 2be5530
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base/timing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ cumulative_compile_time_ns_before() = ccall(:jl_cumulative_compile_time_ns_befor
cumulative_compile_time_ns_after() = ccall(:jl_cumulative_compile_time_ns_after, UInt64, ())
# cumulative total time this thread has spent on compilation since process start.
cumulative_compile_time_ns() = ccall(:jl_cumulative_compile_time_ns, UInt64, ())
function process_cumulative_compile_time_ns()
out = fill(UInt(0), Threads.nthreads())
Threads.@threads for i in 1:Threads.nthreads()
out[i] = cumulative_compile_time_ns()
end
return sum(out)
end

# total time spend in garbage collection, in nanoseconds
gc_time_ns() = ccall(:jl_gc_total_hrtime, UInt64, ())
Expand Down

0 comments on commit 2be5530

Please sign in to comment.