问题描述
我写了一个测试来解决我在程序中遇到的问题
#include <stdio.h>
#include <time.h>
int main()
{
double time;
clock_t begin,end;
begin = clock();
for(int i = 0; i < 100; ++i)
{
}
end = clock();
time = (double)(end - begin) / CLOCKS_PER_SEC;
printf("%lf",time);
}
在线 C 编译器的输出:
0.000002
VS 代码的输出:
0.000000
谁能解释为什么 VS 代码四舍五入为 0?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)