/*****************************************************************
** DemoClock - program to ouput a real-time clock
**
**
** (c) Scott MacKenzie, 2004                             
******************************************************************/
import java.util.*;

public class DemoClock
{
   public static void main(String[] args)
   {
      Calendar today = new GregorianCalendar();
      int seconds = today.get(Calendar.SECOND);
      while (true)
      {
         today.setTime(new Date());
         int newSeconds = today.get(Calendar.SECOND);
         if (newSeconds != seconds)
         {
              System.out.print(today.getTime() + "\r");
              seconds = newSeconds;
         }
      }
   }
}

