#include <time.h>
#include <stdio.h>
void delay(int);
int main(void)
{
clock_t start, end;
start = clock();
delay(10);
end = clock();
printf("The time was:%d\n", (end-start)/CLOCKS_PER_SEC);
printf("%d\n%d\n%d\n", start, end, CLOCKS_PER_SEC);
return 0;
}
void delay(int sec)
{
time_t start_time, cur_time; // 变量声明
time(&start_time);
do {
time(&cur_time);
} while((cur_time - start_time) < sec );
}