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=7ccad037e2ad9629528a6339096d494b633044cf;hp=858f87c80b0f81b94818dcf740440502f1f8dd81;hb=53ed96e828ad57679b6933ebde323b7869191c94;hpb=5bed099be36a76e204265abb2f471d84050c0d66 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 """