Click here to Skip to main content
15,910,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
ForNow31-Jan-23 12:44
ForNow31-Jan-23 12:44 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
Mircea Neacsu31-Jan-23 12:54
Mircea Neacsu31-Jan-23 12:54 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
ForNow31-Jan-23 12:56
ForNow31-Jan-23 12:56 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
jschell2-Feb-23 7:53
jschell2-Feb-23 7:53 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
Mircea Neacsu2-Feb-23 8:03
Mircea Neacsu2-Feb-23 8:03 
GeneralRe: Clang/LLVM support in Visual Studio projects Pin
jschell3-Feb-23 5:01
jschell3-Feb-23 5:01 
QuestionInverted linked list in C Pin
Amine Saber28-Jan-23 21:23
Amine Saber28-Jan-23 21:23 
AnswerRe: Inverted linked list in C Pin
Richard MacCutchan28-Jan-23 22:42
mveRichard MacCutchan28-Jan-23 22:42 
QuestionRe: Inverted linked list in C Pin
David Crow29-Jan-23 12:56
David Crow29-Jan-23 12:56 
QuestionMessage Closed Pin
24-Jan-23 10:52
Member 1496877124-Jan-23 10:52 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
k505424-Jan-23 11:10
mvek505424-Jan-23 11:10 
GeneralMessage Closed Pin
24-Jan-23 12:09
Member 1496877124-Jan-23 12:09 
GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
k505424-Jan-23 12:32
mvek505424-Jan-23 12:32 
GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
Richard MacCutchan24-Jan-23 23:49
mveRichard MacCutchan24-Jan-23 23:49 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
Graham Breach24-Jan-23 11:30
Graham Breach24-Jan-23 11:30 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
Richard MacCutchan24-Jan-23 22:26
mveRichard MacCutchan24-Jan-23 22:26 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
jschell25-Jan-23 5:08
jschell25-Jan-23 5:08 
GeneralRe: Basic C++ - can you explain the difference / function of each definition ? Pin
Richard MacCutchan25-Jan-23 5:21
mveRichard MacCutchan25-Jan-23 5:21 
AnswerRe: Basic C++ - can you explain the difference / function of each definition ? Pin
charlieg28-Jan-23 8:57
charlieg28-Jan-23 8:57 
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 
I've tried e.g. QueryThreadCycleTime as follows:

#include <windows.h>
#include <iostream>

int main()
{

   for (int i = 0; i < 10; ++i)
   {
      uint64_t n1 = 0, n2 = 0;
      BOOL ok1 = QueryThreadCycleTime(GetCurrentThread(), &n1);
      BOOL ok2 = QueryThreadCycleTime(GetCurrentThread(), &n2);

      if (ok1 && ok2)
         std::cout << n2 - n1 << "\n";
      else
         std::cout << "n/a\n";
   }
}


Typical results are:
1036
1114
1734
748
706
670
652
716
652
666


The numbers vary widely - ok, maybe these are expensive calls - but what is the point then?
If I replace the thread cycles with process cycles, numbers get even weirder:

BOOL ok1 = QueryProcessCycleTime(GetCurrentProcess(), &n1);
BOOL ok2 = QueryProcessCycleTime(GetCurrentProcess(), &n2);


With typical results:

39666
39520
304964
145932
47486
287156
191528
208652
196176
288642




This blog post[^] suggests that it should be no worse than QueryPerformanceCounter, but that's not what I'm seeing.

Anyone with insights?


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 

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.