资 源 简 介
[代码说明]
WINDOWS下的SetTimer API可以设置定时器,不过该API只能用在GUI程序中。
我这里为CONSOLE程序实现一个定时器。
开启2个线程:
定时:一个线程定时发送一个消息
处理:一个线程收到消息后处理这个消息
关注点:
为没有窗口的线程实现了消息循环-[Note code] under the SetTimer Windows API can set timer, However, the API can only use the GUI process. I am here to CONSOLE program a timer. Opened two threads : Timing : Timing a thread Send a Message Handling : a thread processing information received after the news of concern : no window to the thread of the news cycle