polishing minute display

This commit is contained in:
Marc Mance
2024-07-29 14:13:07 -04:00
parent 0c1ea95411
commit 2ff24b41dc

View File

@@ -231,6 +231,8 @@ def collect_data(minutes, interval):
# Create a Popen object with stdout redirected to the file # Create a Popen object with stdout redirected to the file
process = subprocess.Popen(gstat_command, stdout=output_file) process = subprocess.Popen(gstat_command, stdout=output_file)
x = 1
for _ in range(minutes * 60 // interval): for _ in range(minutes * 60 // interval):
# Collect data using system commands # Collect data using system commands
@@ -243,7 +245,14 @@ def collect_data(minutes, interval):
# Print progress indicator # Print progress indicator
elapsed_time = (datetime.now() - start_time).total_seconds() // interval elapsed_time = (datetime.now() - start_time).total_seconds() // interval
print(f"Minute {elapsed_time + 1}", flush=True)
if x == 1:
print("Minute:", end="", flush=True)
x = 0
print(f" {int(elapsed_time + 1)}", end="", flush=True)
time.sleep(interval) time.sleep(interval)
# kill gstat if freebsd # kill gstat if freebsd