One of the (sometimes) more annoying aspects of programming a robot is that everything has to be "refreshed" periodically. Certain sensors have to be sampled at a high rate to get good results, speed controllers will stop if you leave them on for too long without setting them, etc. This means that programming a robot actually lends itself fairly well to the IterativeRobot setup: you write your Continuous() and Periodic() methods in a way that won't actually stop the robot from running.
In your case, the best idea is probably to do something like this:
Code:
Timer t = new Timer();
t.start();
while(t.get() < TIME_LIMIT*1000000)
doStuff();
where TIME_LIMIT is your desired length of time in seconds, and doStuff() does stuff (in this case sets motor speed).
If you look at the source of WPILibJ's Timer class, there are a few interesting features: a method reset(), which resets the Timer's value to 0; a constructor which actually calls reset(), meaning that a new Timer always starts at 0; and stop(), which, although it may seem counter-intuitive, does not actually reset it, just prevents it from counting any further. Basically, it does what you want and keeps all the "old time" stuff behind the scenes, so you don't have to worry about it.