예제 #1
0
 @Override
 public void run() {
   long beforeTime = System.currentTimeMillis();
   synchronized (mail) {
     while (mail.getText() == null)
       try {
         mail.wait();
       } catch (Exception e) {
       }
   }
   String name = Thread.currentThread().getName();
   long afterTime = System.currentTimeMillis();
   System.out.format(
       "%s MailServer has got: [%s] in %d ms after start",
       name, mail.getText(), (afterTime - beforeTime));
 }