首页 > 编程语言 > 详细

C语言计算代码执行所耗CPU时钟周期

时间:2016-06-05 22:49:31      阅读:215      评论:0      收藏:0      [点我收藏+]
#include "windows.h"

LARGE_INTEGER _start = { 0 }, _end = { 0 }; __asm{ rdtsc mov dword ptr [_start.LowPart], eax mov dword ptr[_start.HighPart], edx } //your code here __asm{ rdtsc mov dword ptr [_end.LowPart], eax mov dword ptr[_end.HighPart], edx } long interval = static_cast<long>(_end.QuadPart - _start.QuadPart);

 

C语言计算代码执行所耗CPU时钟周期

原文:http://www.cnblogs.com/felixr/p/5561974.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!