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.
- β¨ Minimal & Clean - Simple API with beautiful Unicode progress bars
- β‘ High Performance - Time-based throttling to avoid excessive updates
- π¨ Customizable - Configure colors, width, update intervals, and more
- π ETA Display - Automatic estimation of remaining time
- π§ Zero Dependencies - Only uses Julia's standard library
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
end_progress(stdout, prog)
Output:
[ Info: processing βββββββββββββββββΊβββββββββββββββββββββββ 41% ETA: 00:00:03 s
... (refresh in-place)
[ Info: processing ββββββββββββββββββββββββββββββββββββββββ 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
indent::Int = 4, # Left indentation
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.
keep_bar = true
: Keep the bar visible on screenkeep_bar = false
: Clear the bar from display
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
)
- Use time throttling: The default
update_interval = 3.0
seconds prevents excessive terminal updates - Avoid small intervals: For very large loops (millions of iterations), use intervals β₯ 0.1s
- Let it throttle: Even if you call
show_progress()
every iteration, it will automatically skip redundant updates
- Julia β₯ 1.11
- No external dependencies
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. π€