Click here to Skip to main content
15,890,185 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAre MFC Timer(s) bad for performance in large projects (Vc++) Pin
C3D13-Apr-14 2:23
professionalC3D13-Apr-14 2:23 
AnswerRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Albert Holguin3-Apr-14 3:33
professionalAlbert Holguin3-Apr-14 3:33 
AnswerRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Stefan_Lang3-Apr-14 3:52
Stefan_Lang3-Apr-14 3:52 
GeneralRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Albert Holguin3-Apr-14 4:06
professionalAlbert Holguin3-Apr-14 4:06 
GeneralRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Heng Xiangzhong7-Apr-14 19:34
Heng Xiangzhong7-Apr-14 19:34 
GeneralRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Stefan_Lang7-Apr-14 21:35
Stefan_Lang7-Apr-14 21:35 
GeneralRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Heng Xiangzhong7-Apr-14 23:17
Heng Xiangzhong7-Apr-14 23:17 
GeneralRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Stefan_Lang7-Apr-14 23:49
Stefan_Lang7-Apr-14 23:49 
I understand that english is not your first language - no need to apologize.

As for "waiting" or "callback", I don't see the OP asking about that at all. If his question were about waiting, he should use Sleep()[^] , not timer functions.

I understand the question as one about program performance, i. e. the CPU time it uses. Since the indicated functions don't measure CPU time, their properties are irrelevant. That is why I suggested clock()[^] .

You are correct that it it possible to use higher precision timers. However, most of the time the standard timers are sufficiently accurate for fixing performance issues. That said, the OP suggested comparing times "again and again", implying constant polling - and that doesn't make sense at all! Therefore I made my initial statement about 'inappropriate use' of timers.

There is one other possible scenario that the OP may be referring to: waiting for an operation to finish, but not for longer than a predetermined amount of time. If that is the case, I'd suggest using WaitForMultipleObjects()[^] .
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

Point in case: http://www.infoq.com/news/2014/02/apple_gotofail_lessons[^]

GeneralRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Heng Xiangzhong8-Apr-14 0:56
Heng Xiangzhong8-Apr-14 0:56 
GeneralRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Stefan_Lang8-Apr-14 1:39
Stefan_Lang8-Apr-14 1:39 
GeneralRe: Are MFC Timer(s) bad for performance in large projects (Vc++) Pin
Heng Xiangzhong8-Apr-14 2:04
Heng Xiangzhong8-Apr-14 2:04 
QuestionAdd MFC support to ATL COM DLL project Pin
john56322-Apr-14 23:53
john56322-Apr-14 23:53 
AnswerRe: Add MFC support to ATL COM DLL project Pin
Richard MacCutchan3-Apr-14 0:01
mveRichard MacCutchan3-Apr-14 0:01 
GeneralRe: Add MFC support to ATL COM DLL project Pin
john56323-Apr-14 1:18
john56323-Apr-14 1:18 
GeneralRe: Add MFC support to ATL COM DLL project Pin
Richard MacCutchan3-Apr-14 1:29
mveRichard MacCutchan3-Apr-14 1:29 
GeneralRe: Add MFC support to ATL COM DLL project Pin
john56323-Apr-14 1:54
john56323-Apr-14 1:54 
GeneralRe: Add MFC support to ATL COM DLL project Pin
Richard MacCutchan3-Apr-14 2:51
mveRichard MacCutchan3-Apr-14 2:51 
QuestionHow to know no message in WindowProc callback function? Pin
cedricvictor2-Apr-14 16:34
cedricvictor2-Apr-14 16:34 
AnswerRe: How to know no message in WindowProc callback function? Pin
Richard MacCutchan2-Apr-14 21:32
mveRichard MacCutchan2-Apr-14 21:32 
QuestionImage processing discussion forum? Pin
Vaclav_31-Mar-14 8:49
Vaclav_31-Mar-14 8:49 
AnswerRe: Image processing discussion forum? Pin
SoMad31-Mar-14 9:55
professionalSoMad31-Mar-14 9:55 
AnswerRe: Image processing discussion forum? Pin
Chris Losinger31-Mar-14 10:37
professionalChris Losinger31-Mar-14 10:37 
AnswerRe: Image processing discussion forum? Pin
leon de boer1-Apr-14 5:21
leon de boer1-Apr-14 5:21 
GeneralRe: Image processing discussion forum? Pin
Vaclav_4-Apr-14 3:50
Vaclav_4-Apr-14 3:50 
GeneralRe: Image processing discussion forum - CCL "trace" issue ?? Pin
Vaclav_4-Apr-14 4:50
Vaclav_4-Apr-14 4:50 

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.