[concurrency-interest] Latency in starting threads

Stanimir Simeonoff stanimir at riflexo.com
Tue Apr 16 17:37:10 EDT 2013


On Tue, Apr 16, 2013 at 11:16 PM, Jeff Hain <jeffhain at rocketmail.com> wrote
>
>
> System.currentTimeMillis() might jump around
> with system time
>
System.currentTimeMillis() works quite fine if you use NTP daemon. The NPT
slows down or speeds up the system clock frequency very slightly to adjust,
hence no jumps.


Stanimir



On Tue, Apr 16, 2013 at 11:16 PM, Jeff Hain <jeffhain at rocketmail.com> wrote:

> Hi
>
>
> >long time = System.currentTimeMillis();
>
>
> System.currentTimeMillis() might jump around
> with system time (but I don't mean it's where
> the 250s come from).
>
>
> You could use use System.nanoTime() instead
> when measuring delays (as done in j.u.c):
> Drift, if any, should be slow (ok for small benches),
> and if it jumps (might happen on some broken configurations)
> it should more likely create either obviously crazy or tiny
> time shifts.
> At least I never experienced timing glitches with it
> as I did with System.currentTimeMillis().
>
>
> -Jeff
>
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20130417/115c91fb/attachment-0001.html>


More information about the Concurrency-interest mailing list