/** * Schedules a timer to elapse in the future. If the timer is already running then it will be * first canceled before re-scheduling. * * @param delayMillis how long to wait before the timer elapses, in milliseconds */ public void schedule(int delayMillis) { if (delayMillis < 0) { throw new IllegalArgumentException("must be non-negative"); } if (isRunning()) { cancel(); } isRepeating = false; timerId = setTimeout(createCallback(this, cancelCounter), delayMillis); }
/** * Schedules a timer to elapse in the future. If the timer is already running then it will be * first canceled before re-scheduling. * * @param delayMillis how long to wait before the timer elapses, in milliseconds */ public void schedule(int delayMillis) { if (delayMillis < 0) { throw new IllegalArgumentException("must be non-negative"); } if (isRunning()) { cancel(); } isRepeating = false; timerId = setTimeout(createCallback(this, cancelCounter), delayMillis); }
/** * Schedules a timer to elapse in the future. If the timer is already running then it will be * first canceled before re-scheduling. * * @param delayMillis how long to wait before the timer elapses, in milliseconds */ public void schedule(int delayMillis) { if (delayMillis < 0) { throw new IllegalArgumentException("must be non-negative"); } if (isRunning()) { cancel(); } isRepeating = false; timerId = setTimeout(createCallback(this, cancelCounter), delayMillis); }