Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

How do you program an efficient sleep function in C?

$
0
0

I am programming a basic kernel in C and I want to implement a sleep function. However, the only way I know is creating a very long loop. The downside of this is that processor cycles are wasted and the loop doesn't always take the desired amount of time making the sleep function inefficient and unreliable.

What is the best way of creating a sleep function in C without the use of external libraries, while also ensuring it is efficient?


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>