render time script: also print milliseconds

metadata
Wenzel Jakob 2014-04-30 19:31:03 +02:00
parent e8dfd6c80a
commit 3266aa1cb8
1 changed files with 6 additions and 3 deletions

9
data/scripts/rendertime.py Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/usr/bin/env python
import subprocess, sys, re import subprocess, sys, re
if len(sys.argv) == 1: if len(sys.argv) == 1:
@ -19,12 +21,13 @@ for arg in sys.argv[1:]:
['d', 60*60*24], ['d', 60*60*24],
['h', 60*60], ['h', 60*60],
['m', 60], ['m', 60],
['s', 1] ['s', 1],
['ms', 0.001]
]; ];
for unit in units: for unit in units:
if value[-1] == unit[0]: if value[-len(unit[0]):] == unit[0]:
value = float(value[0:-1]) * unit[1] value = float(value[0:-len(unit[0])]) * unit[1]
break break
force = False force = False