Daniel Pitts <googlegrou...@coloraura.com> wrote or quoted in
Message-ID <1178116602.911032.319...@y5g2000hsa.googlegroups.com>:
long endTime = System.currentTimeMillis() + 60 * 1000;
while (endTime > System.currentTimeMillis()) {
makeRequest();
}
I think that the following code is only proper for simple testing.
<code>
long startTime = System.currentTimeMillis();
... // code block #1
long endTime = System.currentTimeMillis();
long interval = endTime - startTime;
</code>
"interval" is unreliable value because "System.currentTimeMillis()"
returns current time of *system*. In other words, if system time
is set to 01/01/1970 during "#1", the value of "interval" is negative.
Modern clock programs have the function of automatic synchronization
with internet time server (e.g. clock on WinXP tray).