Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   What is the point of timer.delay? (http://www.chiefdelphi.com/forums/showthread.php?t=103072)

NS_Radication 19-02-2012 22:45

Re: What is the point of timer.delay?
 
What exactly is a thread and there can be multiple to change what delays or not.

This is confusing due to a lack of certain terminology.:confused:

Ether 19-02-2012 22:47

Re: What is the point of timer.delay?
 
Quote:

Originally Posted by NS_Radication (Post 1130544)
What exactly is a thread

http://en.wikipedia.org/wiki/Thread_%28computing%29



Chiller 19-02-2012 22:50

Re: What is the point of timer.delay?
 
Threads are amazing!

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.


All times are GMT -5. The time now is 11:27.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi