X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FDebug.scl;h=ba0c7baa9a30f8d96b8391bc066629423ef024b3;hp=858f87c80b0f81b94818dcf740440502f1f8dd81;hb=6e089e3ef1f7e6e3bad6c54a3ce19279796bb6cf;hpb=5bed099be36a76e204265abb2f471d84050c0d66 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