On Sat, Mar 19, 2011 at 12:26 AM, Jarl Haggerty <[email protected]>wrote:
> Is there a reason I can't get this clojure program to compare with the
> java one?
>
> The following code:
>
> for(int q = 0;q < 5;q++){
> Point2D.Float a = new Point2D.Float(1, 2), b = new
> Point2D.Float(3, 4);
> long start = System.currentTimeMillis();
> for(int d = 0;d < (int)1e9;d++){
> a.getX();
> }
> long stop = System.currentTimeMillis();
> System.out.println(stop - start);
> }
>
> prints this:
>
> 7
> 6
> 0
> 0
> 0
That's 1 billion operations getting JITed away. Not really useful for
profiling real programs, eh? :)
David
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en