From 6e089e3ef1f7e6e3bad6c54a3ce19279796bb6cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Tue, 7 Nov 2017 16:01:58 +0200 Subject: [PATCH] (refs #7606) Timing with task name (Debug module) Change-Id: I05aee8105315ac0bb8f6eefdca52334b42ce3149 --- bundles/org.simantics.scl.runtime/scl/Debug.scl | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.47.1