Quick question. Printing System.getTimeMillis()/1000 results in the time in seconds from January 1, 1999- or something like that right? Please correct me if I'm wrong. How would you reset this to display time in seconds starting at 0,1,2,3...?
I simply add elapsed time to a variable to achieve this.
long start = getCurrentTime(); // This is your method that returns time in seconds
long now = start;
long elapsed;
while (running)
{
now = getCurrentTime();
elapsed = now - start;
System.out.println(elapsed);
}
This example prints out the number of seconds starting from 0.