[concurrency-interest] ScheduledThreadPoolExecutor schdeuling problem ?

Doug Lea dl at cs.oswego.edu
Mon Dec 31 16:15:58 EST 2007

Hanson Char wrote:
> Oops, not accuracy but precision, as stated in the System.nanoTime javadoc:
>     "This method provides nanosecond precision, but not necessarily
> nanosecond accuracy"
> But still, I would imagine it would costs more to compute the
> nano-time than milli-time.  

Generally, the opposite, but there are no guarantees.
On most platforms nanoTime is cheaper than currentTimeMillis,
on others about the same. But I don't think there
are any platforms on which the performance
difference is big enough in either direction to
cause anyone to choose one versus the other on performance
grounds alone.


More information about the Concurrency-interest mailing list