This topic is now archived and is closed to further replies.

This topic is 5339 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I am working on a little timer and i want to use RDTSC, if possible. This i call when i want to reset the timer:
__int64 m_cycles;

m_cycles = GetRdtscCycleCount();

inline __int64 CTimer::GetRdtscCycleCount()
	unsigned int dwLow, dwHigh;
		mov dwLow, eax
		mov dwHigh, edx

	return (((__int64) dwHigh) << 32) | ((__int64) dwLow);
And if i want to get the passed ms i do this:
float CTimer::GetPassedMs()
	m_cycles -= GetRdtscCycleCount();
	return (m_cycles/m_cpufreqenz) * 1000.0f;
The problem is that i get very high values when calling GetPassedMs(). So where is my mistake? Thanks, Christian

Share this post

Link to post
Share on other sites