C++ - how does Sleep() and cin work?

后端 未结 7 1876
独厮守ぢ
独厮守ぢ 2021-02-05 10:38

Just curious. How does actually the function Sleep() work (declared in windows.h)? Maybe not just that implementation, but anyone. With that I mean - how is it implemented? How

7条回答
  •  南笙
    南笙 (楼主)
    2021-02-05 11:16

    The operating system schedules how processes run (which processes are eligible to run, in what order, ...). Sleep() probably issues a system call which tells the kernel “don't let me use the processor for x milliseconds”.

提交回复
热议问题