From 18ad0d601eb45d1202fb1f1415249a9ef193e201 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 23 Dec 2024 10:57:32 +0300 Subject: [PATCH] Change placement of flush() call Signed-off-by: Dmitry Solomennikov --- psrecord/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psrecord/main.py b/psrecord/main.py index 1e324d7..66e07f8 100644 --- a/psrecord/main.py +++ b/psrecord/main.py @@ -274,7 +274,6 @@ def monitor( if include_io: f.write(f",{read_count},{write_count},{read_bytes},{write_bytes}") f.write("\n") - f.flush() if interval is not None: time.sleep(interval) @@ -296,6 +295,7 @@ def monitor( # close the logfile, if it's not stdout if logfile and logfile != "": + f.flush() f.close() if plot: