1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-07-31 20:50:15 +02:00

Now logs the time taken to run non OpenSCAD commands in cmd_times.txt

This commit is contained in:
Chris
2022-07-16 08:21:17 +01:00
parent 78b8c2031e
commit 664d04ad93
2 changed files with 7 additions and 1 deletions

View File

@@ -47,7 +47,12 @@ def do_cmd(cmd, output = sys.stdout):
for arg in cmd:
print(arg, end = " ")
print()
return subprocess.call(cmd, stdout = output, stderr = output)
t = time.time()
rv = subprocess.call(cmd, stdout = output, stderr = output)
elapsed = time.time() - t
with open("cmd_times.txt", 'at') as f:
print(cmd[0], cmd[-1], elapsed, file = f)
return rv
def compare_images(a, b, c):
if not os.path.isfile(b):