Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 28857a2

Browse files
committed
Refactor progress bar header and update interval in examples for consistency
1 parent 8b68f4b commit 28857a2

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ using SimulationLogging
3232
# Create a progress bar
3333
prog = MiniProgressBar(
3434
max = 100,
35-
header = "Processing",
35+
header = "processing",
3636
color = :green,
3737
update_interval = 1.0 # Update every second
3838
)
@@ -55,7 +55,11 @@ end_progress(stdout, prog)
5555

5656
**Output:**
5757
```
58-
Processing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00:05 s
58+
[ Info: processing ━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━ 41% ETA: 00:00:03 s
59+
60+
... (refresh in-place)
61+
62+
[ Info: processing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Time: 00:00:05 s
5963
```
6064

6165
## API Reference

test/test.jl

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
using SimulationLogging
22

3-
pb = MiniProgressBar(max=100, header="solving", color=:green, width=38, update_interval=0.1)
3+
prog = MiniProgressBar(
4+
max = 100,
5+
header = "processing",
6+
color = :green,
7+
update_interval = 1.0 # Update every second
8+
)
49

5-
@info "text before for the test"
6-
start_progress(stdout, pb)
10+
# Start tracking progress
11+
start_progress(stdout, prog)
12+
13+
# Update progress in your loop
714
for i in 1:100
8-
pb.current = i
9-
show_progress(stdout, pb)
10-
sleep(0.1) # Simulate work
15+
prog.current = i
16+
show_progress(stdout, prog)
17+
18+
# Your computation here
19+
sleep(0.05)
1120
end
12-
end_progress(stdout, pb)
13-
@info "text after for the test"
21+
22+
# Finish and show final result
23+
end_progress(stdout, prog)

0 commit comments

Comments
 (0)