--- /dev/null
+import "Prelude"
+import "JavaBuiltin" as Java
+
+importJava "java.lang.System" where
+ nanoTime :: () -> <Proc> Long
+
+"""
+Executes the expression and returns the result
+together with execution time in seconds.
+"""
+time :: (<e> a) -> <Proc,e> (a,Double)
+time f = do
+ beginTime = nanoTime ()
+ result = f
+ endTime = nanoTime ()
+ (result, Java.l2d (endTime-beginTime) * 1e-9)
+
+"""
+Prints the given text and returns
+the second parameter.
+"""
+trace :: String -> a -> a
+trace text value = runProc do
+ printString text
+ value
+
+"""
+Prints the given value and returns
+the second parameter.
+"""
+traceShow :: Show a => a -> b -> b
+traceShow p v = trace (show p) v
+