Commit eea7e5e554

Andrew Kelley <andrew@ziglang.org>
2024-05-27 20:21:59
std.Progress: adjust the timings a little bit
Slightly slower refresh rate. It's still updating very quickly. Lower the initial delay so that CLI applications feel more responsive. Even though the application is doing work for the full 500ms until something is displayed on the screen, it feels nicer to get the progress earlier.
1 parent a5e4fe5
Changed files (1)
lib
lib/std/Progress.zig
@@ -59,9 +59,9 @@ pub const Options = struct {
     /// Must be at least 200 bytes.
     draw_buffer: []u8 = &default_draw_buffer,
     /// How many nanoseconds between writing updates to the terminal.
-    refresh_rate_ns: u64 = 60 * std.time.ns_per_ms,
+    refresh_rate_ns: u64 = 80 * std.time.ns_per_ms,
     /// How many nanoseconds to keep the output hidden
-    initial_delay_ns: u64 = 500 * std.time.ns_per_ms,
+    initial_delay_ns: u64 = 200 * std.time.ns_per_ms,
     /// If provided, causes the progress item to have a denominator.
     /// 0 means unknown.
     estimated_total_items: usize = 0,