Click here to Skip to main content
15,907,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMessage Closed Pin
29-Jan-23 3:57
Member 1496877129-Jan-23 3:57 
GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
charlieg1-Feb-23 4:20
charlieg1-Feb-23 4:20 
QuestionQueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
peterchen24-Jan-23 0:34
peterchen24-Jan-23 0:34 
AnswerRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
Richard MacCutchan24-Jan-23 0:44
mveRichard MacCutchan24-Jan-23 0:44 
AnswerRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
CPallini24-Jan-23 2:02
mveCPallini24-Jan-23 2:02 
GeneralRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
Richard MacCutchan24-Jan-23 2:20
mveRichard MacCutchan24-Jan-23 2:20 
GeneralRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
CPallini24-Jan-23 2:32
mveCPallini24-Jan-23 2:32 
AnswerRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
Randor 24-Jan-23 3:49
professional Randor 24-Jan-23 3:49 
peterchen wrote:
This blog post[^] suggests that it should be no worse than QueryPerformanceCounter, but that's not what I'm seeing.
Anyone with insights?


My translation of what you are asking:
peterchen should have asked:
QueryProcessCycleTime uses the RDTSC instruction. QueryPerformanceCounter historically also used the RDTSC instruction. Why aren't they giving similar outputs?


As you probably already know the TSC is superceeded by the HPET. There are a dozen reasons why RDTSC provides inaccurate results. The Meltdown/Spectre mitigations were probably the nail in the coffin so to speak.

The answer to your question is that QueryPerformanceCounter uses the HPET/APIC clock and QueryProcessCycleTime is still using the old rdtsc instruction.

It's apparently a huge mess, @HaroldAptroot says sometimes QueryPerformanceCounter uses HPET and sometimes it doesn't depending on whether or not the TSC is invariant.

modified 24-Jan-23 15:14pm.

GeneralRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
harold aptroot24-Jan-23 8:42
harold aptroot24-Jan-23 8:42 
QuestionRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
Randor 24-Jan-23 9:06
professional Randor 24-Jan-23 9:06 
GeneralRe: QueryThreadCycleTime, QueryProcessCycleTime: what do these number mean? Pin
harold aptroot24-Jan-23 9:26
harold aptroot24-Jan-23 9:26 
QuestionMessage Closed Pin
21-Jan-23 9:57
Member 1496877121-Jan-23 9:57 
AnswerRe: "C++ is static (language)..." Pin
Mircea Neacsu21-Jan-23 10:59
Mircea Neacsu21-Jan-23 10:59 
AnswerRe: "C++ is static (language)..." Pin
Richard MacCutchan21-Jan-23 22:06
mveRichard MacCutchan21-Jan-23 22:06 
AnswerRe: "C++ is static (language)..." Pin
jschell22-Jan-23 8:17
jschell22-Jan-23 8:17 
QuestionCan you make a serial port hooking program? Pin
Member 1590067020-Jan-23 21:07
Member 1590067020-Jan-23 21:07 
AnswerRe: Can you make a serial port hooking program? Pin
Richard MacCutchan20-Jan-23 22:10
mveRichard MacCutchan20-Jan-23 22:10 
AnswerRe: Can you make a serial port hooking program? Pin
CPallini21-Jan-23 3:00
mveCPallini21-Jan-23 3:00 
AnswerRe: Can you make a serial port hooking program? Pin
jschell22-Jan-23 8:23
jschell22-Jan-23 8:23 
AnswerRe: Can you make a serial port hooking program? Pin
charlieg28-Jan-23 8:58
charlieg28-Jan-23 8:58 
QuestionMessage Closed Pin
18-Jan-23 7:36
Member 1496877118-Jan-23 7:36 
AnswerRe: foreach() ?? Pin
Mircea Neacsu18-Jan-23 7:41
Mircea Neacsu18-Jan-23 7:41 
AnswerRe: foreach() ?? Pin
CPallini18-Jan-23 7:51
mveCPallini18-Jan-23 7:51 
GeneralMessage Closed Pin
21-Jan-23 10:04
Member 1496877121-Jan-23 10:04 
GeneralRe: foreach() ?? Pin
jschell22-Jan-23 8:26
jschell22-Jan-23 8:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.