Skip to content

Commit 542debb

Browse files
committed
bisect_hang.py: round down the elapsed time
1 parent 511bb28 commit 542debb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/bisect/bisect_hang.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def run(cppcheck_path, options, elapsed_time=None):
6363
elapsed_time = time.perf_counter() - t
6464
print('elapsed_time: {}'.format(elapsed_time))
6565
# TODO: write to stdout and redirect all all printing to stderr
66-
sys.exit(round(elapsed_time + .5)) # return the time
66+
sys.exit(max(round(elapsed_time - .5), 1)) # return the time
6767

6868
t = time.perf_counter()
6969
run_res = run(cppcheck_path, options, elapsed_time)
@@ -73,7 +73,7 @@ def run(cppcheck_path, options, elapsed_time=None):
7373
# TODO: handle error result
7474
print('elapsed_time: {}'.format(run_time))
7575
# TODO: write to stdout and redirect all printing to stderr
76-
sys.exit(round(run_time + .5)) # return the time
76+
sys.exit(max(round(run_time - .5), 1)) # return the time
7777

7878
if run_res is None:
7979
sys.exit(EC_SKIP) # error occurred

0 commit comments

Comments
 (0)