One of the simplest and easiest ways to have logic for autonomous not run at the same time is to use Thread.sleep(). It lets you run code, have the code halt for a set amount of milliseconds/seconds, then proceed with more code. An example:
Code:
public void autonomousInit() {
try {
leftMotor.set(1);
rightMotor.set(1);
Thread.sleep(1000); //Thread.sleep() takes milliseconds, so 1000 milliseconds = 1 second
leftMotor.set(0);
rightMotor.set(0);
} catch (InterruptedException e) { //Thread.sleep() can throw an InterruptedException, so we have to catch it
e.printStackTrace();
}
}
This code makes the robot drive forward for one second and then stop. The only potential issues with this is that Thread.sleep() halts all code execution on that Thread, so if there is other code that needs to be called constantly you'll either need to not use Thread.sleep() or do multi-threading. In a simple autonomous like this, though, Thread.sleep() should fit your needs perfectly. Just remember that no code after Thread.sleep() will be called until after the delay. Hope this helps!
Also, in the event you want to do multi-threading, let me know and I'll help you out there
