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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Andy Neil
02/18/09 10:30
Read: 9539 times

#162556 - It's IMPOSSIBLE - but here's how...
Responding to: Erik Malund's previous message
Erik Malund said:
you can NEVER predict the duration of a delay in 'C'.

In fact, you can never predict the duration of any piece of high-level language (HLL) source code[1].

You can, of course, examine the generated machine code after compilation - but the effort is (far) more than just writing it in assembler in the first place!

any change (related or not) to your code may change the delay


write it in assembler.


And here's how:

See also:


[1] Unless you have some explicit, compiler-specific extension; eg, the _nop_() "intrinsic" function in Keil.

List of 5 messages in thread
Delay loop in C Programming      Harrison Cheung      02/18/09 09:54      
   you can't        Erik Malund      02/18/09 09:59      
      Timer ticks        Per Westermark      02/18/09 10:28      
      It's IMPOSSIBLE - but here's how...      Andy Neil      02/18/09 10:30      
   You do not      Per Westermark      03/24/09 02:35      

Back to Subject List