C++编程之美-代码清单1-5

代码清单1-5

PROCESSOR_POWER_INFORMATION info;

CallNTPowerInformation(11, 	// query processor power information
     NULL,                    	// no input buffer
     0,                         	// input buffer size is zero
     &info,                    	// output buffer
     Sizeof(info));          	// outbuf size 

     __int64 t_begin = GetCPUTickCount();

     // do something

     __int64 t_end = GetCPUTickCount();
     double millisec = ((double)t_end –(double)t_begin)
        /(double)info.CurrentMhz;
发布了1165 篇原创文章 · 获赞 928 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/weixin_42528266/article/details/104022775