From eea7e5e554ff12b4b72a8aa8877d059e7c055bc3 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 27 May 2024 11:21:59 -0700 Subject: [PATCH] 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. --- lib/std/Progress.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/Progress.zig b/lib/std/Progress.zig index 12874125e2..90dfbfba98 100644 --- 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,