time_start();
int op = 0;
for(int i = 1; i <= n; i++)
op += arr[i]*pow(x, i);
time_stop();
这是我要测量的代码部分,time_start() 和 time_stop() 函数只是将 clock() 输出保存在某处,然后 execution_time() 返回差值,给出执行时间。
问题是对于 < 50000,输出仅为 0 毫秒或 1 毫秒。这是正确的输出吗?这可以更准确吗?
time_start();
int op = 0;
for(int i = 1; i <= n; i++)
op += arr[i]*pow(x, i);
time_stop();
这是我要测量的代码部分,time_start() 和 time_stop() 函数只是将 clock() 输出保存在某处,然后 execution_time() 返回差值,给出执行时间。
问题是对于 < 50000,输出仅为 0 毫秒或 1 毫秒。这是正确的输出吗?这可以更准确吗?