Cで指定されたミリ秒後にタイマーを停止する方法
-
21-12-2019 - |
質問
#include <stdio.h>
#include <time.h>
int main (void)
{
double diff = 0.0;
time_t start;
time_t stop;
time(&start);
print("Enter millisecond to stop");
.
では、指定されたタイマーの間隔の後にコードとは何を停止するべきかを追加する必要があります。
解決
int seconds;
scanf ("%d",&seconds);
stop = 0;
while (stop < start + seconds)
time(&stop);
. 所属していません StackOverflow