如何在C中添加延迟计时器

问题描述 投票:0回答:1

我如何编写C代码,使其等待1秒或其他指定的持续时间转到下一行之前?

例如:我想创建一个秒表

#include<stdio.h>

int main(){
int Time  = 60;
 while(Time>=0){
    printf(Time);
  Time--;
} //i want my code to wait another second before execution of next line/loop
return 0;
}
c time timer
1个回答
0
投票

尝试使用delay(10000)

© www.soinside.com 2019 - 2024. All rights reserved.