可能重复: Getting cpu cycles using RDTSC - why does the value of RDTSC always increase? Get CPU cycle count? 我想要写C++代码,其分析排序算法,以及我需要知道有多少个处理器周期取对数组进行排序。 有关如何做到这一点的任何建议? 我发现这个代码here: uint64_t rdtsc(){
在这本书中确定关键路径计算机系统:程序员的角度,行使5.5显示了一段代码来计算多项式 double poly(double a[], double x, int degree)
{
long int i;
double result = a[0];
double xpwr = x;
for (i = 1; i <= degree; i++) {