The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: asmfan on April 17, 2006, 05:24:05 PM

Title: Timestamp Counters
Post by: asmfan on April 17, 2006, 05:24:05 PM
Am i right? Both GetTickCount and QueryPerformanceCounter are based on RDTSC? The first one returns only low 32 bit in eax arter using RDTSC and the second one returns the full 64 bit in pair edx:eax. Is it correct?
Thanks,
Igor.
Title: Re: Timestamp Counters
Post by: MichaelW on April 17, 2006, 05:52:23 PM
AFAIK the tick count and the performance counters are based on the system timer (PIT). On a Windows 9x system QueryPerformanceFrequency typically returns something close to 1193182, which is the normal input frequency for the PIT. There is some related information here, see posts by dioxin:

http://www.masmforum.com/simple/index.php?topic=3970.0

Title: Re: Timestamp Counters
Post by: P1 on April 17, 2006, 06:02:47 PM
GetTickCount = milliseconds from boot, this is done differently from os to os, AFAIK.  PIT here seems right to me.
QueryPerformanceCounter = cpu clock cycles from boot, where as this a read from the cpu register.  No PIT here.  This is why you can calculate system frequency from this register.

Regards,  P1  :8)
Title: Re: Timestamp Counters
Post by: asmfan on April 17, 2006, 07:11:54 PM
Thanks guys, also wonder could you give me some kind of link to successful use of performance monitor counters (aka PMC) and/or model specific registers (MSR). Assembly commands - RDPMC, RDMSR/WRMSR. Are these command can be well used? And where/what for? Have you ever used them?
Thans.
Title: Re: Timestamp Counters
Post by: P1 on April 17, 2006, 07:38:18 PM
Goto the Intel website, they uP specific opcode documentation for you.

Regards,  P1  :8)