Benchmark: Add unit to time result and format it

When running tests via the cli, format the "time" result
with a unit. For time this is `s` for seconds.

For the graph, the same applies.

Pull Request: https://projects.blender.org/blender/blender/pulls/150690
This commit is contained in:
Christoph Lendenfeld 2025-11-27 16:42:40 +01:00 • committed by Christoph Lendenfeld
parent 02dd8398b6
commit 6327b30133
2 changed files with 3 additions and 1 deletions

View file

@ -105,6 +105,8 @@ class TestGraph:
if output.find("memory") != -1:
formatted_value = '%.2f MB' % (output_value / (1024 * 1024))
elif output == "time":
formatted_value = "%.4f s" % output_value
else:
formatted_value = "%.4f" % output_value

View file

@ -78,7 +78,7 @@ def print_row(config: api.TestConfig, entries: list, end='\n') -> None:
output = entry.output
result = ''
if status in {'done', 'outdated'} and output:
result = '%.4fs' % output['time']
result = '%7.4f s' % output['time']
if status == 'outdated':
result += " (outdated)"