| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
ย | ย | |||
A lightweight and elegant progress bar for Julia, designed for long-running simulations and computations.
Note
The simulation information export function will be involved later.
using Pkg
Pkg.add("SimulationLogging")using SimulationLogging
# Create a progress bar
prog = MiniProgressBar(
max = 100,
header = "processing",
color = :green,
update_interval = 1.0 # Update every second
)
# Start tracking progress
start_progress(stdout, prog)
# Update progress in your loop
for i in 1:100
prog.current = i
show_progress(stdout, prog)
# Your computation here
sleep(0.05)
end
# Finish and show final result
prog.current = 100 # make sure 100% completed
show_progress(stdout, prog) # make sure it shows "100%" in the end
end_progress(stdout, prog)Output:
[ Info: processing 41% โโโโโโโโโโโโโโโโโบโโโโโโโโโโโโโโโโโโโโโโโ ETA: 00:00:03 s ... (refresh in-place) [ Info: processing 100% โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Time: 00:00:05 s
Create a progress bar with customizable options:
MiniProgressBar(;
max::Int = 1, # Maximum value
header::String = "", # Header text
color::Symbol = :nothing, # Bar color (:green, :blue, :red, etc.)
width::Int = 40, # Progress bar width
current::Int = 0, # Current progress value
show_eta::Bool = true, # Show estimated time remaining
update_interval::Float64 = 3.0, # Minimum seconds between updates
always_reprint::Bool = false # Force update every call
)Initialize the progress bar and hide the cursor.
Display the current progress. Automatically throttled by update_interval.
Finalize the progress bar and restore the cursor.
prog = MiniProgressBar(
max = 1000,
header = "Training",
color = :blue,
width = 50,
update_interval = 0.5
)prog = MiniProgressBar(
max = 100,
header = "Loading",
show_eta = false
)prog = MiniProgressBar(
max = 1000000,
header = "Computing",
update_interval = 0.1, # Update every 100ms
always_reprint = false # Respect throttling
)MIT License - see LICENSE file for details
Caution
I primarily based my implementation on Pkg.jl, with the remaining features mainly developed using Claude Sonnet 4.5, including this very statement itself. ๐ค
| Back | FazBrowse Home | New Git URL |