将clock_t转化为秒值在Windows与Linux平台下的差异
平时写测试程序的时候常常要计算程序执行的时间,尤其是最近练习Intel多核编程时,需要判断打开openmp参数与否的执行时间的比较。通常代码是这样写的:#include clock_t start, stop;....start = clock();do_something();stop = clock();printf("%f", (double)(stop-start)/1000.0) ;..... 或者是求当前时间的秒值:double t = (do...