tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: getCurrentTimeMillis definition in JDBCAccessValve
Date Mon, 02 Aug 2010 22:15:52 GMT
On 02/08/2010 23:12, Channing Benson wrote:
> Hi,
> 
> What am I missing here?
> 
> In JDBCAccessValve, the method getCurrentTimeMillis is defined as
> 
>     public long getCurrentTimeMillis() {
>         long systime  =  System.currentTimeMillis();
>         if ((systime - currentTimeMillis) > 1000) {
>             currentTimeMillis  =  new java.util.Date(systime).getTime();
>         }
>         return currentTimeMillis;
>     }
> 
> I can figure out that this method artificially dials down the resolution of the recorded
time, but to what end? Why not just use System.currentTimeMillis() directly?
> 
> Any edification is appreciated.

Speed. This way we only generate a new date string every 1s.

Mark



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


Mime
View raw message