linux centos中c++ sleep函数怎么写?
网友回复
用usleep() 单位是微秒(百万分之一秒)。
#include <iostream> using namespace std; #include <unistd.h> int main() { cout << "hello\n" << endl; //sleep(1); usleep(1000000); cout << "world\n" << endl; }
linux centos中c++ sleep函数怎么写?
网友回复
用usleep() 单位是微秒(百万分之一秒)。
#include <iostream> using namespace std; #include <unistd.h> int main() { cout << "hello\n" << endl; //sleep(1); usleep(1000000); cout << "world\n" << endl; }