question: private void sched ( TimerTask task , long time , long period ) { if ( time < 0 ) throw new IllegalArgumentException ( "Illegal execution time." ) ; if ( Math . abs ( period ) > ( Long . MAX_VALUE > > 1 ) ) period >>= 1 ; synchronized ( queue ) { if ( ! thread . newTasksMayBeScheduled ) throw new IllegalStateException ( "Timer already cancelled." ) ; synchronized ( task . lock ) { if ( task . state != TimerTask . VIRGIN ) throw new IllegalStateException ( "Task already scheduled or cancelled" ) ; task . nextExecutionTime = time ; task . period = period ; task . state = TimerTask . SCHEDULED ; } queue . add ( task ) ; if ( queue . getMin ( ) == task ) queue . notify ( ) ; } }
target:  Schedule the specified timer task for execution at the specified time with the specified period, in milliseconds.  If period is positive, the task is scheduled for repeated execution; if period is zero, the task is scheduled for one-time execution. Time is specified in Date.getTime() format.  This method checks timer state, task state, and initial execution time, but not period.