Hi
I'm seraching for a tutorial where "delay" is explained. I have already looked up in serveral books but I can`t find.
thanks
my e-mail: [email protected]
Hi
I'm seraching for a tutorial where "delay" is explained. I have already looked up in serveral books but I can`t find.
thanks
my e-mail: [email protected]
The function delay is not part of ANSI C. But you can use the time functions to do something like that, or find a special function your compiler supports.
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
you can delay a certain portion of your program
by implementing a loop
e.g
myDelay(){
for (i=0;i=100000;i++){ // this will delay for some time
}
}
" programming is 1% syntax and 99% logic "
Note that lliero is machine dependent.
>Note that lliero is machine dependent.
Yes, depending on the processor speed of the machine running that code it will take more or less time to complete the loop. This function will work a bit more portably.
-PreludeCode:#include <time.h> void delay ( long n ) { clock_t l, c = clock(); for ( l = c + n; l > c; c = clock() ); }
My best code is written with the delete key.