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.
This commit is contained in:
Andrew Kelley 2024-05-27 11:21:59 -07:00
parent a5e4fe5487
commit eea7e5e554

View File

@ -59,9 +59,9 @@ pub const Options = struct {
/// Must be at least 200 bytes. /// Must be at least 200 bytes.
draw_buffer: []u8 = &default_draw_buffer, draw_buffer: []u8 = &default_draw_buffer,
/// How many nanoseconds between writing updates to the terminal. /// 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 /// 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. /// If provided, causes the progress item to have a denominator.
/// 0 means unknown. /// 0 means unknown.
estimated_total_items: usize = 0, estimated_total_items: usize = 0,