Sleep function in C++

后端 未结 7 1631
情书的邮戳
情书的邮戳 2020-11-27 03:27

Is there a function like Sleep(time); that pauses the program for X milliseconds, but in C++?

Which header should I add and what is the function\'s sign

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 03:33

    For Windows:

    #include "windows.h" 
    Sleep(10);
    

    For Unix:

    #include 
    usleep(10)
    

提交回复
热议问题