2014-04-12 16:27 GMT+02:00 Fergal Byrne <fergalbyrnedub...@gmail.com>:

> (defn timed-foo [times n]
>   (let [start (now)]
>     (foo n)
>     (conj times [n (- (now) start)])))
>
> (defn format-time [[n t]]
>   (format "%2d threads took %7d milliseconds" n t))
>
> (->> numbers
>      (reduce timed-foo [])
>      (map format-time)
>      println)
>

I do not know this construction yet. But it works. The only problem is
that the output is:
( 2 threads took    6148 milliseconds  4 threads took    3069 milliseconds
6 threads took    2477 milliseconds  7 threads took    2249 milliseconds  8
threads took    2079 milliseconds)

and I would like:
 2 threads took    6148 milliseconds
 4 threads took    3069 milliseconds
 6 threads took    2477 milliseconds
 7 threads took    2249 milliseconds
 8 threads took    2079 milliseconds

How would I do that?

-- 
Cecil Westerhof

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to