可等待时间对象是指具有在特定到期时间到达时发出信号的角色的同步对象。请注意,当定时器发出信号时,处理器必须执行相关的指令。因此,如果您设置使处理器保持忙碌的高频周期性计时器,则意味着您的计算机无法长时间保持低功耗状态。
CWaitableTimer计时器一般来说,CWaitableTimer计时器创建计时器对象需要访问使用 CreateWaitableTimer 或 CreateWariableTimerEx 的线程。根据您想要实现的目标,您可以创建手动重置计时器或同步计时器。虽然在第一种情况下,定时器保持信号状态,直到调用定时器来建立一个新的定时器,后者需要状态保持不变,直到线程完成对定时器对象的等待操作。
CWaitableTimer被设计为 Win32 可等待计时器的 MFC 类 即使可等待计时器在 Windows 95 或 NT 3.x 上不可用,代码将在这些操作系统上执行正确的操作,而不会导致操作系统加载程序导致您的程序加载失败,并显示错误消息“未定义调用函数...”。不用说,代码启用了 Unicode 并提供了构建配置。
The CWaitableTimer was designed to be an MFC class for Win32 waitable timers Even though waitable timers are not available on Windows 95 or NT 3.x, the code will do the right thing on these operating systems without causing the OS loader to cause your program to fail to load, with the error message "Call to function not defined... ". it goes without saying that the code is Unicode enabled and build configurations are provided.