#include <iostream>
#include <ctime>
using namespace std;
int getTime() {
return clock()/CLOCKS_PER_SEC;
}
int main() {
int i = 0;
int lastTime = 0;
while (1) {
int now = getTime();
if (now - lastTime > 0) {
cout << ++i << endl;
lastTime = now;
}
}
return 0;
}
时间: 2024-11-01 23:31:59