public void run(){
  while (true) {
    long oldTimeStamp=timeStampMS;
synchronized (monitor) {
      while (oldTimeStamp == timeStampMS) {
        try {
          monitor.wait();
        }
 catch (        InterruptedException e) {
        }
      }
    }
    long currTimeStamp=timeStampMS;
    while (currTimeStamp < timeStampMS + CLEAR_AFTER_TIME_MS) {
      try {
        Thread.sleep(SLEEP_PERIOD_MS);
      }
 catch (      InterruptedException e) {
      }
      currTimeStamp=System.currentTimeMillis();
    }
    resetLabel();
  }
}

public void run ( ) { while ( true ) { long oldTimeStamp = timeStampMS ; synchronized ( monitor ) { while ( oldTimeStamp == timeStampMS ) { try { monitor . wait ( ) ; } catch ( InterruptedException e ) { } } } long currTimeStamp = timeStampMS ; while ( currTimeStamp < timeStampMS + CLEAR_AFTER_TIME_MS ) { try { Thread . sleep ( SLEEP_PERIOD_MS ) ; } catch ( InterruptedException e ) { } currTimeStamp = System . currentTimeMillis ( ) ; } resetLabel ( ) ; } }
the deamon loop that monitors the updates to the label and resets , when necessary , the label .
