Skip to content

Commit

Permalink
timelimit
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Jun 23, 2024
1 parent 0b2934d commit c99b0bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/compare-valueflow-options.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import subprocess


# Do not report execution times below this limit, short execution time measurements are flaky
TIME_LIMIT = 2


def format_float(a, b=1):
if a > 0 and b > 0:
return '{:.2f}'.format(a / b)
Expand Down Expand Up @@ -176,7 +180,7 @@ def count_errors(errout:str, c:set):
current_count = results.get(error_id, 0)
if count > current_count:
myfile.write(f'{id}: FN {error_id}: {current_count} of {count}\n')
if time > 10 or time0 > 10:
if time > TIME_LIMIT or time0 > TIME_LIMIT:
myfile.write(f'{id}: Time: %.1f\n' % time)
time_factor = time / time0
myfile.write(f'{id}: Timefactor: %.3f\n' % time_factor)
Expand Down

0 comments on commit c99b0bb

Please sign in to comment.