View Single Post
  #1   Spotlight this post!  
Unread 01-27-2015, 10:04 AM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,998
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Command Based Programming (Threads?)


Thanks for the response. I hope you don't mind some follow-up questions:

Quote:
Originally Posted by notmattlythgoe View Post
I would suggest using a WaitCommand in a CommandGroup. Below is an example that will fire, then wait 1 second before firing again and then finishing the CommandGroup.

Code:
public FiringCommandGroup extends CommandGroup {

     public FiringCommandGroup() {
          addSequential(new FireCommand());
          addSeqiential(new waitCommand(1));
          addSequential(new FireCommand());
     }
}
What does the waitCommand() do, "under the hood". i.e., how is it implemented?

Quote:
Another way to do it would be to check the time passed in the execute method of a command to see if the period of time you want to wait has passed.
Is there a "recommended" or "best practice" way to implement that approach?


Reply With Quote