// System.out.println( "start timer for " + duration + "ms");
synchronized (this) {
try {
wait(duration);
} catch (Exception e) {
e.printStackTrace();
}
}
if (!stopped) {
for (int i = 0; i < listeners.size(); i++) {
TimerListener listener = (TimerListener) listeners.elementAt(i);
listener.timerExpired();
}
}