You might want to investigate using
WPILib. You can use a function like
sleep() (except it's called
wait()) there because it handles things differently. See the bottom of page 50 of the
manual (pdf). More information is available in the
WPILib section of this forum.
For someone coming from a InteractiveC background it might be much more familiar.