CodePudding user response:
no oneCodePudding user response:
Timer message priority level is very low, the accuracy is not high, is suitable for the situation of accuracy is not high, the condition of high precision recommended threadsCodePudding user response:
WM_TIMER low priority, if your program in ordinary do drawing or produce a lot of other priority is higher than its message, then its processing becomes slowly, and then, a timer itself is affected by the CPU is large, if the CPU load is very high, WM_TIMER the time difference will not, if you used to do simulation clock, then I suggest you SetTimer timeout setting a shorter, then inside WM_TIMER processing function as the basis of the refresh with real time difference:Such as the SetTimer timeout is set to 100 ms, every OnTimer back off when judging whether the current time and the last time difference & gt; 1000 ms, and then decide whether to refresh:
VOID GetLocalTime (LPSYSTEMTIME LPSYSTEMTIME//the system time);
CodePudding user response:
The Timer is low priorityCodePudding user response:
Thread in the appropriate Sleep,WM_TIMER as long as there is a message in the message queue will not be distributed, so the thread sends a message to a message queue can affect the timer
CodePudding user response:
The WM_TIMER message is a low priority message. The GetMessage and PeekMessage functions provides post this message only when no other who - priority messages are in The thread 's message queue.CodePudding user response:
Also will cause the message thread thread takes up too much CPU card, update slow is normal.Or you POST to the UI thread in the thread of messages very much (may be SET_WINDOWTEXT messages sent you thread, set the text information), low priority WM_TIMER message is not so easy to get a response.
CodePudding user response:
Above all, will,