Is there an alternative for sleep() in C?
问题 In traditional embedded programming, we will give a delay function like so: for(i=0;i<255;i++) for(j=0;j<255;j++); In the microprocessor's view, is this how the sleep() function works? Is there an alternative for the sleep() function in C? 回答1: Alternatives depend in what you are trying to do and what OS you are on. If you just want to waste time, then these might help: On most unix-type systems you'll find a 'usleep' function, which is more or less like sleep with greater resolution. Be