| Sunstroke |
20-02-2012 03:15 |
Re: What is the point of timer.delay?
Quote:
Originally Posted by gixxy
(Post 1130196)
I know that if you put in a Timer.delay() it will delay EVERYTHING. I put in a 4 second delay on a command to stop it from being called too often, but during that 4 seconds I couldn't do anything, the DriveTrain,our BallFeed belt. everything was frozen.
|
The command system is actually not multithreaded. There is one thread that goes around and constantly calls the initialize/execute/... on each running command. So using Timer.delay in a command is a terrible idea.
However, you can use the WaitCommand in a command group, or you can use the timeSinceInitialized() method built into each command to do some timing based code.
|