ProgressMeter.jl icon indicating copy to clipboard operation
ProgressMeter.jl copied to clipboard

Progress to exceed real-valued threshold?

Open NAThompson opened this issue 4 years ago • 0 comments

Hopefully this isn't noise, but after reading the documentation, I didn't see a natural way to create a progress bar which displays progress to exceed a real-valued parameter.

For example, what I would like is something like:

julia> using Unitful
julia> using ProgressMeter
julia> tf = 2.0u"s"
julia> p = ProgressTo(tf, 1)
julia> t = 0.0u"s"
julia> while t < tf
           t += randn()
           update!(p, t)
       end     

The closest thing I found was the ProgressThresh, but this displays progress to going below a certain real value.

Note: I have the following workaround:

julia> n = Int64(round(ustrip(tf)*1000000000000)) # hope this is an integer!
julia> p = Progress(n, 1)

and then make the same conversion with the time.

NAThompson avatar Nov 07 '21 17:11 NAThompson