Re: System.currentTimeMillis() on SMP systems

Jeffrey Kesselman <[email protected]> Sat, 10 May 2008 18:06:34 -0400
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <[email protected]>
Are you awae that accuracy is not gauranteed on currentTimeMillis()?  It
varies from paltform to platform and can be quite low (50ms on XP).

nanoTimer() however is gauranteed to be the best resolution available to
the platform

Peter Booth wrote:
> Can you be specific?
>
> On May 9, 2008, at 1:32 PM, Rodrick Brown wrote:
>
>> On Fri, May 9, 2008 at 12:45 PM, Carfield Yim <[email protected]>
>> wrote:
>>
>>> What exactly is the problem?
>>>
>>> On Wed, May 7, 2008 at 10:37 PM, Rodrick Brown
>>> <[email protected]>
>>> wrote:
>>>> I'm stress testing my backend server and I wrote a small client
>>> application
>>>> that uses System.currentTimeMillis() on various operations the results
>>> dont
>>>> seem to be consistent with what I would expect my system is a 8 core
>>> Intel
>>>> x64 class machine running 64 Bit linux. I heard about issues with
>>>> System.currentTimeMillis() on SMP machines is this true? Is there a
>>> better
>>>> approach I should be taking?
>>>>
>>>
>>> ===================================
>>> This list is hosted by DevelopMentor(R)  http://www.develop.com
>>>
>>> View archives and manage your subscription(s) at
>>> http://discuss.develop.com
>>>
>> The operations being timed over X number of iterations don't seem to co
>> relate with the System.currentTimeMillis() start/end calculations.
>>
>> --
>> [ Rodrick R. Brown ]
>> http://www.rodrickbrown.com http://www.linkedin.com/in/rodrickbrown
>>
>> ===================================
>> This list is hosted by DevelopMentorĀ®  http://www.develop.com
>>
>> View archives and manage your subscription(s) at
>> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentorĀ®  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com