如何计算一秒内可执行的命令行数

#include #include using namespace std; const double N = 100000000; const double SEC = 1000; int main() { LARGE_INTEGER nFrequency; ::QueryPerformanceFrequency(&nFrequency); LARGE_INTEGER nStartCounter; LARGE_INTEGER nStopCounter; ::QueryPerformanceCounter(&nStartCounter); for (int i=0; i

 

N*SEC/nTime 348432055.74912894 double

跟我之前的测试有差距
SetThreadAffOn a multiprocessor computer, it should not matter which processor is called. However, you can get different results on different processors due to bugs in the basic input/output system (BIOS) or the hardware abstraction layer (HAL). To specify processor affinity for a thread, use the SetThreadAffinityMask function.

你可能感兴趣的:(C/C++/C#)