random!@#% Posted December 19, 2010 Posted December 19, 2010 What is the programming term for when you delay an action in a line of code? I'm just starting to learn programming and I was going to look up how to do it.
D H Posted December 19, 2010 Posted December 19, 2010 Could you be a bit more illustrative of what you are talking about? Computer language, operating system, application domain, perhaps an example of what you mean?
khaled Posted February 6, 2011 Posted February 6, 2011 What is the programming term for when you delay an action in a line of code? I'm just starting to learn programming and I was going to look up how to do it. delay doing something in a normal program, in C\C++ you do Sleep using OS-specific calls in Java you use Thread.sleep(..) if you want to delay a procedure, and keep your program running, you assign the work to a thread that sleeps amount of time .. you may in Java create a new class extending Thread class, and do Thread.sleep(..) inside, then the action ... if you mean delaying decision of writing line of code, you use ? symbol in the code, and use back-patch(..) method, which back-patches the ? into codes you decided later ...
ewmon Posted February 6, 2011 Posted February 6, 2011 What is the programming term for when you delay an action in a line of code? Busy waiting or spinning can be used to generate an arbitrary time delay.
D H Posted February 6, 2011 Posted February 6, 2011 (edited) Busy waiting or spinning can be used to generate an arbitrary time delay. Ew mon, ewmon! Right there in your link it says "In general, however, spinning is considered an anti-pattern and should be avoided, as processor time that could be used to execute a different task is instead wasted on useless activity." Except for the simplest of systems, there is almost always some other mechanism available that is far preferable to a busy loop. Edited February 6, 2011 by D H 1
ewmon Posted February 7, 2011 Posted February 7, 2011 Ew mon, ewmon! Right there in your link it says "In general, however, spinning is considered an anti-pattern and should be avoided, as processor time that could be used to execute a different task is instead wasted on useless activity." Except for the simplest of systems, there is almost always some other mechanism available that is far preferable to a busy loop. Forgive me, for I am only ewmon. I have also used wait and sleep functions, but I don't know their generic/descriptive names.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now