Click here to Skip to main content
15,899,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Measuring the thread running duration. Pin
Roger Stoltz24-Nov-08 3:05
Roger Stoltz24-Nov-08 3:05 
GeneralRe: Measuring the thread running duration. Pin
Ahmed Charfeddine27-Nov-08 9:25
Ahmed Charfeddine27-Nov-08 9:25 
GeneralRe: Measuring the thread running duration. Pin
Roger Stoltz27-Nov-08 10:23
Roger Stoltz27-Nov-08 10:23 
GeneralRe: Measuring the thread running duration. Pin
Ahmed Charfeddine27-Nov-08 11:01
Ahmed Charfeddine27-Nov-08 11:01 
QuestionRe: Measuring the thread running duration. Pin
Roger Stoltz27-Nov-08 11:37
Roger Stoltz27-Nov-08 11:37 
AnswerRe: Measuring the thread running duration. Pin
Ahmed Charfeddine27-Nov-08 12:00
Ahmed Charfeddine27-Nov-08 12:00 
GeneralRe: Measuring the thread running duration. Pin
Roger Stoltz27-Nov-08 12:12
Roger Stoltz27-Nov-08 12:12 
AnswerRe: Measuring the thread running duration. [modified] Pin
akirilov24-Nov-08 4:28
akirilov24-Nov-08 4:28 
In the past I thought that QueryPerformanceCounter achieves this by querying a counter that is incremented each time that a particular thread spends an addtional CPU cycle. It measure the CPU cycles from the turning on the PC, not "a particular thread" (this include all other threads).

You received the same result as Sleep, because ... well, Sleep is very accurate, that is why people use it instead of WM_TIMER.

Now to your question ... QueryPerformanceCounter will not do the job.

P.S. I doubt it cost a CPU time, as previously somebody stated, at least not more than WaitForSingleObject.

modified on Monday, November 24, 2008 10:39 AM

AnswerRe: Measuring the thread running duration. Pin
Roger Stoltz24-Nov-08 5:08
Roger Stoltz24-Nov-08 5:08 
QuestionHow to check if running under administrator account on Vista from MFC app? Pin
mkoroudjiev24-Nov-08 1:58
mkoroudjiev24-Nov-08 1:58 
AnswerRe: How to check if running under administrator account on Vista from MFC app? Pin
Mark Salsbery24-Nov-08 6:28
Mark Salsbery24-Nov-08 6:28 
GeneralRe: How to check if running under administrator account on Vista from MFC app? Pin
mkoroudjiev24-Nov-08 7:55
mkoroudjiev24-Nov-08 7:55 
GeneralRe: How to check if running under administrator account on Vista from MFC app? Pin
Mark Salsbery24-Nov-08 10:54
Mark Salsbery24-Nov-08 10:54 
GeneralRe: How to check if running under administrator account on Vista from MFC app? Pin
mkoroudjiev24-Nov-08 18:50
mkoroudjiev24-Nov-08 18:50 
GeneralRe: How to check if running under administrator account on Vista from MFC app? Pin
Mark Salsbery25-Nov-08 7:04
Mark Salsbery25-Nov-08 7:04 
Questioninstallation path Pin
NewVC++24-Nov-08 1:03
NewVC++24-Nov-08 1:03 
AnswerRe: installation path Pin
_AnsHUMAN_ 24-Nov-08 1:38
_AnsHUMAN_ 24-Nov-08 1:38 
AnswerRe: installation path Pin
krmed24-Nov-08 3:25
krmed24-Nov-08 3:25 
AnswerRe: installation path Pin
Jijo.Raj24-Nov-08 6:44
Jijo.Raj24-Nov-08 6:44 
QuestionListview item Pin
ashishmax4724-Nov-08 0:32
ashishmax4724-Nov-08 0:32 
AnswerRe: Listview item Pin
_AnsHUMAN_ 24-Nov-08 0:56
_AnsHUMAN_ 24-Nov-08 0:56 
GeneralRe: Listview item Pin
ashishmax4724-Nov-08 1:24
ashishmax4724-Nov-08 1:24 
GeneralRe: Listview item Pin
_AnsHUMAN_ 24-Nov-08 1:31
_AnsHUMAN_ 24-Nov-08 1:31 
GeneralRe: Listview item Pin
ashishmax4724-Nov-08 1:42
ashishmax4724-Nov-08 1:42 
GeneralRe: Listview item Pin
_AnsHUMAN_ 24-Nov-08 1:52
_AnsHUMAN_ 24-Nov-08 1:52 

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.