View Single Post
Old 2006-07-30, 02:57   #2
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

1101110100002 Posts
Default

Quote:
Originally Posted by geoff
Just unzip and type `make', it will run two test programs, one in 32 bit mode and one in 64 bit mode, and print the results to a file `k8.txt'. Post that file or any errors here, or send me a PM.
You may want to use a higher-resolution timer...

jasonp
Code:
uint64
read_clock( void ) {

#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
	uint32 lo, hi;
	asm("rdtsc":"=d"(hi),"=a"(lo));
	return (uint64)hi << 32 | lo;

#elif defined(_MSC_VER)
	LARGE_INTEGER ret;
	QueryPerformanceCounter(&ret);
	return ret.QuadPart;

#else
	struct timeval thistime;   
	gettimeofday(&thistime, NULL);
	return thistime.tv_sec * 1000000 + thistime.tv_usec;
#endif
}
jasonp is offline   Reply With Quote