#include<time.h> #include<stdio.h> #include<windows.h> main() { time_t start, end; start = time(NULL); Sleep(10); end = time(NULL); printf("runtime is:%f(s)\n", difftime(start,end)); getchar(); }