All pastes #462518 Raw Edit

Someone

public c v1 · immutable
#462518 ·published 2007-04-28 10:26 UTC
rendered paste body
#include <windows.h>#include <cstdio>#include <iostream>__declspec(naked)unsigned __int64 __cdecl rdtsc(void){	__asm	{		rdtsc		ret       ; return value at EDX:EAX	}}int main(int argc, char *argv[]){	unsigned __int64 begin;	unsigned __int64 end;	unsigned __int64 result = 0;	unsigned __int64 overhead = 0;	int number = 10000;	int  temp;	int  i;	printf("Number: %ld\n", number);	begin = rdtsc();	for (int i = 0; i < 10000; i++)	{		;	}	end = rdtsc();	overhead = end - begin;	begin = rdtsc();	for (int i = 0; i < 10000; i++)	{		temp = number % 2;	}	end = rdtsc();	result = (end - begin) / 10000;	result -= overhead;	std::cout << "Ticks: " << result << std::endl;	system("PAUSE");}