Commit ecbebe7a authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Report the time it takes for each command to execute.

parent f465c242
......@@ -148,9 +148,12 @@ def mysystem(x, outputDir=None):
g_log = open(outputDir + os.sep + "log.txt", "w")
return
g_log.write("From: " + os.getcwd() + "\n")
g_log.write(x + "\n")
g_log.flush()
startTime = time.time()
while os.system(x) != 0:
deltaTime = 'Took %4.1f sec: ' % (time.time() - startTime)
g_log.write(deltaTime + x + "\n")
g_log.flush()
startTime = time.time()
# Save the environment that was used for the failed command under OUTPUT_FOLDER/env.txt
if g_absOutputDir != "":
os.system('env > "' + g_absOutputDir + os.sep + 'env.txt"')
......@@ -169,6 +172,9 @@ def mysystem(x, outputDir=None):
panic("\nFailed to compile...")
else:
panic("Failed while executing:\n" + x + "\nFrom this directory:\n" + os.getcwd())
deltaTime = 'Took %4.1f sec: ' % (time.time() - startTime)
g_log.write(deltaTime + x + "\n")
g_log.flush()
def getSingleLineFromCmdOutput(cmd):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment