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