X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FDebug.scl;h=7ccad037e2ad9629528a6339096d494b633044cf;hb=33b30297f751e06e9abac260d31313e2f833fedc;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..7ccad037e 100644 --- a/bundles/org.simantics.scl.runtime/scl/Debug.scl +++ b/bundles/org.simantics.scl.runtime/scl/Debug.scl @@ -1,6 +1,8 @@ import "Prelude" import "JavaBuiltin" as Java +import "Logging" as LOGGER + importJava "java.lang.System" where nanoTime :: () -> Long @@ -21,7 +23,16 @@ reportTime f = runProc do result = f endTime = nanoTime () time = Java.l2d (endTime-beginTime) * 1e-9 - print "time \(time) s" + LOGGER.info "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 + LOGGER.info "\(task): \(time) s" result """