OAIP_Mirror/clock/main.c
2024-11-10 13:45:07 +04:00

16 lines
392 B
C

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <Windows.h>
int main() {
int n = 10, sl = 10, last_clock = 0;
clock_t start = clock();
for (int i = 0; i < n; i++) {
printf_s("%d\n", i);
Sleep(sl);
}
printf_s("time = %.3lf seconds\nexpected %d seconds %lf", (double)(clock() - start) / (double)CLOCKS_PER_SEC, n * sl / 1000, 0.3300000000000000000000);
return 0;
}