commit eea7e5e554ff12b4b72a8aa8877d059e7c055bc3 (tree)
parent a5e4fe5487d2ac8d8bafceb6edba8ae2d87aa86c
Author: Andrew Kelley <andrew@ziglang.org>
Date: Mon, 27 May 2024 11:21:59 -0700
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.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/std/Progress.zig b/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,