X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FDebug.scl;fp=bundles%2Forg.simantics.scl.runtime%2Fscl%2FDebug.scl;h=858f87c80b0f81b94818dcf740440502f1f8dd81;hb=5bed099be36a76e204265abb2f471d84050c0d66;hp=94112010044ae102b99fa350eb0e168ef6ffcf0d;hpb=6570cdea204ffa0b6a4e16ac12778fab883b49ec;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 941120100..858f87c80 100644 --- a/bundles/org.simantics.scl.runtime/scl/Debug.scl +++ b/bundles/org.simantics.scl.runtime/scl/Debug.scl @@ -15,6 +15,15 @@ time f = do endTime = nanoTime () (result, Java.l2d (endTime-beginTime) * 1e-9) +reportTime :: ( a) -> a +reportTime f = runProc do + beginTime = nanoTime () + result = f + endTime = nanoTime () + time = Java.l2d (endTime-beginTime) * 1e-9 + print "time \(time) s" + result + """ Prints the given text and returns the second parameter.