]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.runtime/scl/Debug.scl
(refs #7606) Timing with task name (Debug module)
[simantics/platform.git] / bundles / org.simantics.scl.runtime / scl / Debug.scl
index 858f87c80b0f81b94818dcf740440502f1f8dd81..ba0c7baa9a30f8d96b8391bc066629423ef024b3 100644 (file)
@@ -23,6 +23,15 @@ reportTime f = runProc do
     time = Java.l2d (endTime-beginTime) * 1e-9
     print "time \(time) s"
     result
+    
+reportTimeM :: String -> (<e> a) -> <e> a
+reportTimeM task f = runProc do
+    beginTime = nanoTime ()
+    result = f
+    endTime = nanoTime ()
+    time = Java.l2d (endTime-beginTime) * 1e-9
+    print "\(task): \(time) s"
+    result    
 
 """
 Prints the given text and returns