For the motor's safety, if it doesn't get called often, it'll automatically stop it. And Timer.delay() stops the whole thread.
I'm assuming you want to run the motor for 8 seconds, this is one way you could do:
Code:
public void autonomous() {
Timer timer = new Timer();
timer.start();
while (isAutonomous() && isEnabled()) {
if(timer.get() < 8) { // Double check this; don't exactly remember what it returns
driveTrain.drive(0.5, 0.0);
}
Timer.delay(0.005);
}
timer.stop();
}