public void schedule(Runnable command,long delay,long tolerance,TimeUnit unit){
  if (delay < 0 || tolerance < 0) {
    throw new IllegalArgumentException();
  }
  long triggerPoint=clock.now() + unit.toMillis(delay);
  scheduledTasks.add(new ScheduledRunnable(command,triggerPoint,unit.toMillis(tolerance)));
  if (signal.compareAndSet(false,true)) {
    selector.wakeup();
  }
}

public void schedule ( Runnable command , long delay , long tolerance , TimeUnit unit ) { if ( delay < 0 || tolerance < 0 ) { throw new IllegalArgumentException ( ) ; } long triggerPoint = clock . now ( ) + unit . toMillis ( delay ) ; scheduledTasks . add ( new ScheduledRunnable ( command , triggerPoint , unit . toMillis ( tolerance ) ) ) ; if ( signal . compareAndSet ( false , true ) ) { selector . wakeup ( ) ; } }
schedules the runnable for future execution on the internal runloopthread .
