defftime函数输出错误
#include<time.h>#include<stdio.h>
#include<dos.h>
main()
{
time_t start, end;
start = time(NULL);
sleep(10);
end = time(NULL);
printf("runtime is:%f(s)\n", difftime(start,end));
getch();
}
请问这条代码哪里出错了,谢谢!
#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(); }