Re: timing for map

2009-06-07 Thread Kyle R. Burton
I map produces a lazy sequence, time doesn't force it, if you wrap it in either a dorun or doall, you should get what you expect: user> (time (map #(Thread/sleep %) '(1000 1000 1000))) "Elapsed time: 0.156 msecs" (nil nil nil) user> (time (doall (map #(Thread/sleep %) '(1000 1000 1000 "Elapse

timing for map

2009-06-07 Thread artg
user=> (time (map answer '(50 50))) "Elapsed time: 0.032826 msecs" (392330 392711) user=> (time (answer 50)) "Elapsed time: 6357.131423 msecs" 392849 When I try to time 'map' it seems to return right away. How do I time the full two executions of 'answer'? --~--~-~--~~--