Procházet zdrojové kódy

Added timing to protocoll.

Kristian Schultz před 3 roky
rodič
revize
fe9df69a74
1 změnil soubory, kde provedl 8 přidání a 1 odebrání
  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 = [