X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FDebug.scl;h=ba0c7baa9a30f8d96b8391bc066629423ef024b3;hb=bdafd889bd2c5c11d6f9036ac791d143b23098e0;hp=858f87c80b0f81b94818dcf740440502f1f8dd81;hpb=5bed099be36a76e204265abb2f471d84050c0d66;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.runtime/scl/Debug.scl b/bundles/org.simantics.scl.runtime/scl/Debug.scl index 858f87c80..ba0c7baa9 100644 --- a/bundles/org.simantics.scl.runtime/scl/Debug.scl +++ b/bundles/org.simantics.scl.runtime/scl/Debug.scl @@ -23,6 +23,15 @@ reportTime f = runProc do time = Java.l2d (endTime-beginTime) * 1e-9 print "time \(time) s" result + +reportTimeM :: String -> ( a) -> 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