Is QueryPerformanceCounter equal to RDTSC in function?
Posted on 2003-09-29 23:39:20 by optimus
RDTSC is a pentium instruction, ReaD Time Stamp Count
Posted on 2003-09-30 02:29:20 by optimus
Why write API that will emulate CPU instructions? ;)

imho
Posted on 2003-09-30 02:32:34 by S.T.A.S.
hehe there are many (**some**) API that do just that:emulate CPU instructions.
To the above RTDSC one might add the winsock byte swap routines and also the DIV routines :D

I presume this is done for languages that do not have inline ASM directive or to keep code portable to another CPU or network byte order
Posted on 2003-09-30 03:06:49 by BogdanOntanu
I presume this is done for languages that do not have inline ASM directive or to keep code portable to another CPU or network byte order

Anyway I'm confused :grin:

But this can help benchmarking some scripts :grin:
Posted on 2003-09-30 03:15:24 by S.T.A.S.
I thought QueryPerformanceCounter used "whatever high-precision timer is available"?
Posted on 2003-09-30 03:25:57 by f0dder
Yes indeed,

The Querry performance counter API is supposed to use the hardware counter on the motherboard (aka 8253) and RDTSC reads the counter inside of the CPU :D

So:
-Querry performance counter works at a fixed resolution (hence the need for QuerryPerformance Frequency API--used to find out this freq.)
-while will RDTSC run at CPU speed.

Using both you can easyly detect CPU speed ;)
Posted on 2003-09-30 06:10:19 by BogdanOntanu