How to delay in the program

zhaozj2021-02-16  59

How to delay in the program: 1 SLEEP (2000)

2 SLEEP is simple, but if the delay is relatively long, the system is like a crash, the following method can handle the message when delayed:

COleDateTime starttime = COleDateTime :: GetCurrentTime (); COleDateTimeSpan endtime = COleDateTime :: GetCurrentTime () - starttime; while (endtime.GetTotalSeconds () <2) {MSG msg; GetMessage (& msg, 0,0); PreTranslateMessage (& msg); EndTime = COLEDATETIME :: getcurrenttime () - starttime;

转载请注明原文地址:https://www.9cbs.com/read-19368.html

New Post(0)