Forum Discussion
Altera_Forum
Honored Contributor
12 years agoCheck this out..
http://stackoverflow.com/questions/7083482/how-to-prevent-compiler-optimization-on-a-small-piece-of-code They offer a work around, but in general it's better to use an os sleep style command that's based on a hardware timer. (and frees up other processes to run). The optimizer is doing what it's suppose to, optimizing the code. As far as it can tell, there's no need to do the loops, so it removes them. Pete