X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FDebug.scl;h=ba0c7baa9a30f8d96b8391bc066629423ef024b3;hb=e02b565cb604469a1dad9c5143e5f1664fec5ebf;hp=94112010044ae102b99fa350eb0e168ef6ffcf0d;hpb=969bd23cab98a79ca9101af33334000879fb60c5;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..ba0c7baa9 100644 --- a/bundles/org.simantics.scl.runtime/scl/Debug.scl +++ b/bundles/org.simantics.scl.runtime/scl/Debug.scl @@ -15,6 +15,24 @@ 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 + +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 the second parameter.