From c0785fd1d4faa207a728227f9527804bb79d129a Mon Sep 17 00:00:00 2001 From: Daejun Park Date: Tue, 19 Nov 2024 14:34:29 -0800 Subject: [PATCH] display elapsed time --- src/halmos/sevm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/halmos/sevm.py b/src/halmos/sevm.py index 3d629b1c..98cc2e72 100644 --- a/src/halmos/sevm.py +++ b/src/halmos/sevm.py @@ -5,6 +5,7 @@ from collections.abc import Callable, Iterator from copy import deepcopy from dataclasses import dataclass, field +from datetime import timedelta from functools import reduce from timeit import default_timer as timer from typing import ( @@ -2669,8 +2670,12 @@ def finalize(ex: Exec): if step_id % PULSE_INTERVAL == 0: elapsed = timer() - stack.start_time speed = step_id / elapsed + + # hh:mm:ss + elapsed_fmt = str(timedelta(seconds=elapsed)).split(".")[0] + status.update( - f"pulse: {step_id} ops ({speed:.2f} ops/s) | " + f"pulse: [{elapsed_fmt}] {step_id} ops ({speed:.2f} ops/s) | " f"completed paths: {stack.completed_paths} | outstanding paths: {len(stack)}" )