This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

delay milisecond

Hi all Iam using STR912FW44 based board and I want a delay function that should give the delay in milisecond I made a function

void delay_ms (unsigned long nCount){   /* Wait function                    */
  nCount=nCount+16000000L;

  while (nCount--);
}


when I call

delay_ms(10000);

it gives arround 10 second delay but when I call

delay_ms(20000);
it should give arround 20 second delay but it does not happen

but when I call

delay_ms(10000);
delay_ms(10000);

it gives arround 15 sec delay

please tell me exact way to build a delay function

regards
rupesh

0