Posted: Fri Apr 21, 2006 12:47 pm Post subject: (No subject)
use this... put it in the same directory as your program... and in your program put "Delay.stop(int);" before whatever you want delayed.... just like in turing.
The Extension 'class' was deactivated by an board admin, therefore this Attachment is not displayed.
xHoly-Divinity
Posted: Wed Apr 26, 2006 4:10 pm Post subject: (No subject)
Our teacher taught us to use a useless for loop that runs like a million times . I guess that works as well
HellblazerX
Posted: Wed Apr 26, 2006 8:37 pm Post subject: (No subject)
errrr not really, cuz you're delaying by the number of times your CPU can go through that for loop, so the slower comp you have, the longer delay you'll have.
[Gandalf]
Posted: Thu Apr 27, 2006 12:49 am Post subject: (No subject)
xHoly-Divinity wrote:
Our teacher taught us to use a useless for loop that runs like a million times . I guess that works as well
This is far worse than using processes in Turing, and you know how bad that is. Unless, of course, you have a constant frame rate, but even then using the Thread.sleep() method is what you should be using.
codemage
Posted: Thu Apr 27, 2006 8:48 am Post subject: (No subject)
Posted: Fri Apr 28, 2006 2:08 am Post subject: (No subject)
Note that you don't need to explicitly state that you're delaying currentThread(), Thread.sleep() should be sufficient, especially since you're probably only working with the default Thread.
Sponsor Sponsor
Martin
Posted: Fri Apr 28, 2006 3:49 am Post subject: (No subject)
code:
void delay_a_bit() {
for (int i=0;i<1000000;++i) {
int x = Math.sqrt (i * i);
}
}