authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-05-27 11:21:59-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-05-27 20:56:49-07:00
logeea7e5e554ff12b4b72a8aa8877d059e7c055bc3
tree94e29b7bdbab1f16178b4c3dc7e35f5c7217271c
parenta5e4fe5487d2ac8d8bafceb6edba8ae2d87aa86c

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 files changed, 2 insertions(+), 2 deletions(-)

lib/std/Progress.zig+2-2
......@@ -59,9 +59,9 @@ pub const Options = struct {
5959 /// Must be at least 200 bytes.
6060 draw_buffer: []u8 = &default_draw_buffer,
6161 /// How many nanoseconds between writing updates to the terminal.
62 refresh_rate_ns: u64 = 60 * std.time.ns_per_ms,
62 refresh_rate_ns: u64 = 80 * std.time.ns_per_ms,
6363 /// How many nanoseconds to keep the output hidden
64 initial_delay_ns: u64 = 500 * std.time.ns_per_ms,
64 initial_delay_ns: u64 = 200 * std.time.ns_per_ms,
6565 /// If provided, causes the progress item to have a denominator.
6666 /// 0 means unknown.
6767 estimated_total_items: usize = 0,