clock_t t = clock();
sleep(10);
t = clock() - t;
printf ("It took me %d clicks (%f seconds).\n",t,((float)t)/CLOCKS_PER_SEC);
在 macOS 上为什么不是接近于 10 而是 4.0-4.5 之间?
就算不除以 CLOCKS_PER_SEC 也不是接近于 10 的数,在 QT 和 xcode 上测都是这样。
sleep(10);
t = clock() - t;
printf ("It took me %d clicks (%f seconds).\n",t,((float)t)/CLOCKS_PER_SEC);
在 macOS 上为什么不是接近于 10 而是 4.0-4.5 之间?
就算不除以 CLOCKS_PER_SEC 也不是接近于 10 的数,在 QT 和 xcode 上测都是这样。