> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 20:11:36 up 7 days, 5:09, 1 user, load average: 0.62, 0.69, 0.45
This commit is contained in:
@ -3,9 +3,15 @@
|
||||
|
||||
int main(void) {
|
||||
struct timeval t;
|
||||
long time, prev;
|
||||
gettimeofday(&t, NULL);
|
||||
prev = t.tv_usec;
|
||||
while(1) {
|
||||
gettimeofday(&t, NULL);
|
||||
if (t.tv_sec % 2 == 0)
|
||||
printf("Hello World\n");
|
||||
time = t.tv_usec;
|
||||
if (time - prev >= 500000) {
|
||||
prev = time;
|
||||
printf("Hello World\n");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user