public void start ( float startPercent , long duration , ResultListener < TimerView > finisher ) { // Sanity check input arguments if ( startPercent < 0.0f || startPercent >= 1.0f ) { throw new IllegalArgumentException ( "Invalid starting percent " + startPercent ) ; } if ( duration < 0 ) { throw new IllegalArgumentException ( "Invalid duration " + duration ) ; } // Stop any current processing stop ( ) ; // Record the timer's full duration and effective start time _duration = duration ; // Change the completion percent and make sure the starting // time gets updated on the next tick changeComplete ( startPercent ) ; _start = Long . MIN_VALUE ; // Thank you sir; would you kindly take a chair in the waiting room? _finisher = finisher ; // The warning and completion handlers haven't been triggered yet _warned = false ; _completed = false ; // Start things running _running = true ; }
Start the timer running from the specified percentage complete to expire at the specified time .