/*****************************************************************
** CountSeconds - demonstrate the currentTimeMillis() method
**
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
public class CountSeconds
{
   public static void main(String[] args)
   {
      long start = System.currentTimeMillis();
      long seconds = 0;
      while(true)
      {
         long temp = System.currentTimeMillis();
         long newSeconds = (temp - start) / 1000;
         if (newSeconds != seconds)
         {
            System.out.print(newSeconds + " ");
            seconds = newSeconds;
         }
      }
   }
}

