sleep actually interfaces with operating system, where sleeping processes are placed outside of scheduling queue. I usually use:
poll(0, 0, milliseconds);
for POSIX compliant systems. select
also works for windows (they must have a native API (probably called Sleep
) for that.)