TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Robot.java
/**
     * waitForTick should only be used within a loop (use Thread.sleep for other purposes). This is so that in a loop it waits
     * at least for the time put in, but if the loop has already taken that long it will just pass over the method
     *
     * @param periodMs The length of time you want each loop cycle to take
     */
waitForTick should only be used within a loop (use Thread.sleep for other purposes). This is so that in a loop it waits
at least for the time put in, but if the loop has already taken that long it will just pass over the method

@param periodMs The length of time you want each loop cycle to take
waitForTick should only be used within a loop ( use Thread . sleep for other purposes ) . This is so that in a loop it waits at least for the time put in but if the loop has already taken that long it will just pass over the method @param periodMs The length of time you want each loop cycle to take
public void waitForTick(long periodMs, ElapsedTime elapsedTime) {
        long remaining = periodMs - (long) elapsedTime.milliseconds();
        if (remaining > 0) {
            try {
                Thread.sleep(remaining);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
        elapsedTime.reset();
    }
public void waitForTick ( long periodMs , ElapsedTime elapsedTime ) { long remaining = periodMs - ( long ) elapsedTime . milliseconds ( ) ; if ( remaining > 0 ) { try { Thread . sleep ( remaining ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } elapsedTime . reset ( ) ; }
waitForTick should only be used within a loop (use Thread.sleep for other purposes).
waitForTick should only be used within a loop ( use Thread . sleep for other purposes ) .
// sleep for the remaining portion of the regular cycle period. //Reset the cycle clock for the next pass.