Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/02/12 13:02
Read: times


 
#186356 - Delay
Responding to: ???'s previous message
By the way - spend some time picking up the wibes on using a busy-loop as delay:
void delay(unsigned int ms) {
    unsigned char n;
    unsigned int i;
    for(n=0;n<ms;n++) {
        for(i=0;i<count;i++) ;
    }
}

Exactly how do you know this function really gives a delay of "ms" milliseconds?
Why not use a delay that base the delay time on real, clocked hardware - like for example a hw timer? Wouldn't it be a huge advantage if the delay isn't greatly changed by compiler version or compiler options?

List of 7 messages in thread
TopicAuthorDate
Help me            01/01/70 00:00      
   Descriptive?            01/01/70 00:00      
      Delay            01/01/70 00:00      
         Why loop with char for int parameter?            01/01/70 00:00      
   Tips            01/01/70 00:00      
      Satish, you're not helping yourself here ...            01/01/70 00:00      
         is this the "helping yourself" you refer to?            01/01/70 00:00      

Back to Subject List