25 Mar 2004 09:27
Re: New static groovy methods
On 25 Mar 2004, at 07:49, Yuri Schimke wrote:
> Is there any great advantage of making it a method on closure, or a
> default method on any core java/groovy class?
>
> Its probably a good candidate for a util package.
>
> import groovy.util.Timer;
>
> Timer.time { ... }
>
> Seems just as clear, but doesn't add extra methods to core classes.
Agreed. Also you may want to get the elapsed time for something. e.g.
t = Timer.time { ... }.elapsedTime
James
-------
http://radio.weblogs.com/0112098/
RSS Feed