Is it possible to cast the Elapsed Time function to Integer?
- by nuvio
I have the following function:
(def elapsedtime (with-out-str (time (run-my-function))))
and I was wondering if is possible to store only the integer value of the time, as I can only store a String at the moment....
Any suggestion?
Thanks a lot
UPDATE
So I did use this:
(defmacro nsecs
[expr]
`(let [start# (. System (nanoTime))]
~expr
(- (. System (nanoTime)) start#)))
And then modified this:
(def elapsedtime (nsecs (run-my-function argument1 argument2)))
but doesn't work, what am I doing wrong?
"Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Wrong number of args (1) passed to: main$fn--105$nsecs"