From 928fcc6ff9ca8e646fb5c1f48073c915045e317f Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Wed, 19 Feb 2025 10:18:55 -0500 Subject: [PATCH] fix total deltas Co-Authored-By: BenCurran98 <73566276+bencurran98@users.noreply.github.com> --- src/show.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/show.jl b/src/show.jl index 585e01e..c3a061d 100644 --- a/src/show.jl +++ b/src/show.jl @@ -8,9 +8,8 @@ function Base.show(io::IO, to::TimerOutput; allocations::Bool = true, sortby::Sy sortby in (:time, :ncalls, :allocations, :name, :firstexec) || throw(ArgumentError("sortby should be :time, :allocations, :ncalls, :name, or :firstexec, got $sortby")) linechars in (:unicode, :ascii) || throw(ArgumentError("linechars should be :unicode or :ascii, got $linechars")) - t₀, b₀ = to.start_data.time, to.start_data.allocs - t₁, b₁ = time_ns(), gc_bytes() - Δt, Δb = t₁ - t₀, b₁ - b₀ + # make sure the deltas we report actually match the time elapsed - can cause problems if we go back to look at results at a later time + Δt, Δb = totmeasured(to) ∑t, ∑b = to.flattened ? to.totmeasured : totmeasured(to) max_name = longest_name(to)