question: void onMoved ( ) { double diff = System . currentTimeMillis ( ) - timeStamp ; timeStamp = 0 ; if ( diff > DISCARD_THRESHOLD ) { return ; } double recentJitter = 0 ; double sum = 0.0 ; for ( int i = 0 ; i < VECTOR_LENGTH ; i ++ ) { double old = times [ i ] ; double avg = ( diff + old ) / 2 ; recentJitter += Math . abs ( old - diff ) ; times [ i ] = avg ; diff = old ; sum += avg ; } recentJitter /= 8 ; jitter = ( jitter + 2.0 * Math . max ( jitter , recentJitter ) + recentJitter ) / 4.0 ; prediction = TURN_LENGTH / ( sum / VECTOR_LENGTH + jitter ) ; WtWindowManager wm = WtWindowManager . getInstance ( ) ; wm . setProperty ( SPEED_PROPERTY , Double . toString ( prediction ) ) ; wm . setProperty ( JITTER_PROPERTY , Double . toString ( jitter ) ) ; }
target:  Called when the user moves. Marks the end of a timing instance.