commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@Elsag-Solutions.com>
Subject RE: [POLL] System.currentTimeMillis()
Date Thu, 15 Dec 2005 10:13:36 GMT
Hi Antonio,

Antonio Gallardo wrote on Thursday, December 15, 2005 10:53 AM:
[snip] 
> 
> Jörg,
> 
> Can the StopWatch class in commons-lang help?
>
> http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/lang/
> trunk/src/java/org/apache/commons/lang/time/StopWatch.java?view=markup

Not really, since its implementation suffers also from such a time-shifting daemon.
 
> I am just thinking that this nice research is also useful for
> reviewing the StopWatch class too.

I am quite sure, that a unit test ensuring that StopWatch.getTime() never returns a negative
number can be written so that it will fail in our Gump environment. But I doubt, that the
StopWatch implementation can or should really do something about it.

I wonder which other classes may be affected by such time shifts also. I never really took
that into account previously (although I was aware of the problem writing the time based id
generator). Since it gets quite common that applications run in VMs (especially if a company
uses the VMWare servers), the problem might arise more often in future ...

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message