Parcourir la source

Added timing to protocoll.

Kristian Schultz il y a 3 ans
Parent
commit
fe9df69a74
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  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 = [