]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
(refs #7606) Timing with task name (Debug module) 05/1205/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 7 Nov 2017 14:01:58 +0000 (16:01 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Tue, 7 Nov 2017 14:01:58 +0000 (16:01 +0200)
Change-Id: I05aee8105315ac0bb8f6eefdca52334b42ce3149

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