mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
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:
parent
02dd8398b6
commit
6327b30133
2 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue