Explorar o código

Added timing to protocoll.

Kristian Schultz %!s(int64=3) %!d(string=hai) anos
pai
achega
fe9df69a74
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      library/analysis.py

+ 8 - 1
library/analysis.py

@@ -162,10 +162,17 @@ def runExercise(datasetName, resultList, ganName, ganCreator, skipIfCsvExists=Tr
     if resultList is not None:
         resultList[datasetName] = avg
 
+    print(f"  wall time: {showTime(twEnd - twStart)}s, process time: {showTime(tpEnd - tpStart)}s")
+
+    sys.stdout = open(resultsFileName + ".log.time", "w")
+    print(f"Running {ganName} on {datasetName}")
+    print(f"wall time (s): {showTime(twEnd - twStart)}\nprocess time (s): {showTime(tpEnd - tpStart)}")
+
+
     sys.stdout = oldStdOut
     sys.stderr = oldStdErr
 
-    print(f"  wall time: {showTime(twEnd - twStart)}s, process time: {showTime(tpEnd - tpStart)}")
+    print(f"  wall time: {showTime(twEnd - twStart)}s, process time: {showTime(tpEnd - tpStart)}s")
 
     
 testSets = [