为什么SetWaitableTimer的参数LARGE_INTEGER要制定一个负数? 不明白
作者:未知 来源:网络 更新时间:2011/6/10
#005 HANDLE hTimer = NULL;
#006 LARGE_INTEGER liDueTime;
#007
#008 //设置相对时间为10秒。
#009 liDueTime.QuadPart = -100000000;//////为什么是负数?????????????????
#010
#011 //创建定时器。
#012 hTimer = CreateWaitableTimer(NULL, TRUE, _T("TestWaitableTimer"));
#013 if (!hTimer)
#014 {
#015 return 1;
#016 }
#017
#018 OutputDebugString(_T("10秒定时器\r\n"));
#019
#020 // 设置10秒钟。
#021 if (!SetWaitableTimer(hTimer, &liDueTime, 0, NULL, NULL, 0))
#022 {
#023 //
#024 CloseHandle(hTimer);
#025 return 2;
#026 }
---华软 网友回答---
Positive values indicate absolute time. Be sure to use a UTC-based absolute time, as the system uses UTC-based time internally. Negative values indicate relative time. The actual timer accuracy depends on the capability of your hardware.
---华软网友回复---
如果值是正的,代表一个特定的时刻。如果值是负的,代表以100纳秒为单位的相对时间。后面的示例代码中使用的
华软声明:本内容来自网络,如有侵犯您版权请来信指出,本站立即删除。
#006 LARGE_INTEGER liDueTime;
#007
#008 //设置相对时间为10秒。
#009 liDueTime.QuadPart = -100000000;//////为什么是负数?????????????????
#010
#011 //创建定时器。
#012 hTimer = CreateWaitableTimer(NULL, TRUE, _T("TestWaitableTimer"));
#013 if (!hTimer)
#014 {
#015 return 1;
#016 }
#017
#018 OutputDebugString(_T("10秒定时器\r\n"));
#019
#020 // 设置10秒钟。
#021 if (!SetWaitableTimer(hTimer, &liDueTime, 0, NULL, NULL, 0))
#022 {
#023 //
#024 CloseHandle(hTimer);
#025 return 2;
#026 }
---华软 网友回答---
Positive values indicate absolute time. Be sure to use a UTC-based absolute time, as the system uses UTC-based time internally. Negative values indicate relative time. The actual timer accuracy depends on the capability of your hardware.
---华软网友回复---
如果值是正的,代表一个特定的时刻。如果值是负的,代表以100纳秒为单位的相对时间。后面的示例代码中使用的
华软声明:本内容来自网络,如有侵犯您版权请来信指出,本站立即删除。