From f0efb1cb190c090cda191c244ee9051c31674d95 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 15 Jan 2024 20:34:30 +0530 Subject: [PATCH] Also clear screen at end of each loop when rendering --- tools/cmd/benchmark/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/cmd/benchmark/main.go b/tools/cmd/benchmark/main.go index 18c721017..dac608ffc 100644 --- a/tools/cmd/benchmark/main.go +++ b/tools/cmd/benchmark/main.go @@ -73,16 +73,18 @@ func benchmark_data(description string, data string, opts Options) (duration tim } start := time.Now() + end_of_loop_reset := desc + if !opts.Render { + end_of_loop_reset += resume_rendering + pause_rendering + } for reps < opts.Repetitions { if err = write_with_retry(data); err != nil { return } sent_data_size += len(data) reps += 1 - if !opts.Render { - if err = write_with_retry(desc + resume_rendering + pause_rendering); err != nil { - return - } + if err = write_with_retry(end_of_loop_reset); err != nil { + return } } finalize := clear_screen + "Waiting for response indicating parsing finished\r\n"