Просто посмотрите на количество времени между настоящим и следующим разом, когда вы должны проснуться, и поспать столько времени. Поэтому вместо того, чтобы устанавливать повторяющийся таймер на отключение каждые n секунд, при каждом пробуждении установите таймер однократного выключения, для того, сколько бы времени вам ни потребовалось между настоящим моментом и следующей точкой на временной шкале.
Обновление : я написал тестовую программу, чтобы увидеть, будет ли повторяющийся таймер смещаться.
Программа запускается в начале следующей минуты, а затем активируется каждые 5 секунд:
#include <windows.h>
#include<stdio.h>
ULONGLONG convertTime(SYSTEMTIME st) {
FILETIME ft;
ULARGE_INTEGER tm;
SystemTimeToFileTime(&st, &ft);
tm.u.LowPart = ft.dwLowDateTime;
tm.u.HighPart = ft.dwHighDateTime;
return tm.QuadPart;
}
ULONGLONG getNextMinute() {
SYSTEMTIME now;
GetSystemTime(&now);
ULONGLONG ONE_MINUTE = 60 * 10000000;
ULONGLONG nowNumeric = convertTime(now);
ULONGLONG desiredTime = ((ULONGLONG)(nowNumeric / ONE_MINUTE)) * ONE_MINUTE + ONE_MINUTE;
return desiredTime;
}
int main(int argc, char* argv[]) {
ULONGLONG startTimeForTimer = getNextMinute();
HANDLE hTimer = NULL;
hTimer = CreateWaitableTimer(NULL, FALSE, NULL);
if (NULL == hTimer) {
printf("CreateWaitableTimer failed (%d)\n", GetLastError());
return 1;
}
printf("Waiting for the next minute to start...\n");
// Set a timer to wait for 5 seconds.
if (!SetWaitableTimer(hTimer, &startTimeForTimer, 5000, NULL, NULL, 0))
{
printf("SetWaitableTimer failed (%d)\n", GetLastError());
return 2;
}
// Wait for the timer.
SYSTEMTIME beforeTime;
SYSTEMTIME afterTime;
GetSystemTime(&beforeTime);
while (WaitForSingleObject(hTimer, INFINITE) == WAIT_OBJECT_0) {
GetSystemTime(&afterTime);
ULONGLONG elapsedTime = convertTime(afterTime) - convertTime(beforeTime);
printf("Timer was signaled: elapsed=%I64u, seconds=%02d.%02d\n", elapsedTime, afterTime.wSecond, afterTime.wMilliseconds);
GetSystemTime(&beforeTime);
}
return 0;
}
А вот результаты (с удалением некоторых неинтересных битов) после некоторого запуска. Бит seconds=
- это количество секунд (с точностью до 1000 секунды) после текущей минуты:
Timer was signaled: elapsed=297650000, seconds=59.98
Timer was signaled: elapsed=50000000, seconds=04.986
Timer was signaled: elapsed=50000000, seconds=09.986
Timer was signaled: elapsed=50000000, seconds=14.986
Timer was signaled: elapsed=50000000, seconds=19.986
...
Timer was signaled: elapsed=50000000, seconds=09.986
Timer was signaled: elapsed=49990000, seconds=14.985
Timer was signaled: elapsed=50000000, seconds=19.985
...
Timer was signaled: elapsed=50000000, seconds=24.985
Timer was signaled: elapsed=49990000, seconds=29.984
...
Timer was signaled: elapsed=50000000, seconds=54.973
Timer was signaled: elapsed=50000000, seconds=59.973
Timer was signaled: elapsed=50000000, seconds=04.973
Timer was signaled: elapsed=49990000, seconds=09.972
Timer was signaled: elapsed=50000000, seconds=14.972
Timer was signaled: elapsed=50000000, seconds=19.972
Timer was signaled: elapsed=50000000, seconds=24.972
Timer was signaled: elapsed=50020000, seconds=29.974
Timer was signaled: elapsed=50020000, seconds=34.976
Timer was signaled: elapsed=50020000, seconds=39.978
Timer was signaled: elapsed=50020000, seconds=44.980
Timer was signaled: elapsed=50020000, seconds=49.982
Timer was signaled: elapsed=50020000, seconds=54.984
Timer was signaled: elapsed=50010000, seconds=59.985
Timer was signaled: elapsed=50020000, seconds=04.987
Timer was signaled: elapsed=50020000, seconds=09.989
Timer was signaled: elapsed=50020000, seconds=14.991
Timer was signaled: elapsed=50020000, seconds=19.993
Timer was signaled: elapsed=50020000, seconds=24.995
Timer was signaled: elapsed=50020000, seconds=29.997
Timer was signaled: elapsed=50020000, seconds=34.999
Timer was signaled: elapsed=50020000, seconds=40.01
Timer was signaled: elapsed=50020000, seconds=45.03
Timer was signaled: elapsed=50020000, seconds=50.05
Timer was signaled: elapsed=50020000, seconds=55.07
Timer was signaled: elapsed=50020000, seconds=00.09
Timer was signaled: elapsed=50010000, seconds=05.10
Timer was signaled: elapsed=50020000, seconds=10.12
Timer was signaled: elapsed=50020000, seconds=15.14
Timer was signaled: elapsed=50020000, seconds=20.16
Timer was signaled: elapsed=50020000, seconds=25.18
Timer was signaled: elapsed=50020000, seconds=30.20
Timer was signaled: elapsed=50020000, seconds=35.22
Timer was signaled: elapsed=50020000, seconds=40.24
Timer was signaled: elapsed=50020000, seconds=45.26
Timer was signaled: elapsed=50020000, seconds=50.28
Timer was signaled: elapsed=50020000, seconds=55.30
Timer was signaled: elapsed=50020000, seconds=00.32
Timer was signaled: elapsed=50010000, seconds=05.33
Timer was signaled: elapsed=50020000, seconds=10.35
Timer was signaled: elapsed=50020000, seconds=15.37
Timer was signaled: elapsed=50020000, seconds=20.39
Timer was signaled: elapsed=50020000, seconds=25.41
Timer was signaled: elapsed=50020000, seconds=30.43
Timer was signaled: elapsed=50020000, seconds=35.45
Timer was signaled: elapsed=50020000, seconds=40.47
Timer was signaled: elapsed=50020000, seconds=45.49
Timer was signaled: elapsed=50020000, seconds=50.51
Timer was signaled: elapsed=50020000, seconds=55.53
Timer was signaled: elapsed=50170000, seconds=00.70
Timer was signaled: elapsed=49870000, seconds=05.57
Timer was signaled: elapsed=50010000, seconds=10.58
Timer was signaled: elapsed=50020000, seconds=15.60
Timer was signaled: elapsed=50020000, seconds=20.62
Timer was signaled: elapsed=50020000, seconds=25.64
Timer was signaled: elapsed=50020000, seconds=30.66
Timer was signaled: elapsed=50020000, seconds=35.68
Timer was signaled: elapsed=50020000, seconds=40.70
Timer was signaled: elapsed=50020000, seconds=45.72
Timer was signaled: elapsed=50020000, seconds=50.74
Timer was signaled: elapsed=50020000, seconds=55.76
Timer was signaled: elapsed=50020000, seconds=00.78
Timer was signaled: elapsed=50020000, seconds=05.80
Timer was signaled: elapsed=50010000, seconds=10.81
Timer was signaled: elapsed=50020000, seconds=15.83
Timer was signaled: elapsed=50020000, seconds=20.85
Timer was signaled: elapsed=50020000, seconds=25.87
Timer was signaled: elapsed=50010000, seconds=30.88
Timer was signaled: elapsed=50010000, seconds=35.89
Timer was signaled: elapsed=50000000, seconds=40.89
Timer was signaled: elapsed=50010000, seconds=45.90
Timer was signaled: elapsed=50010000, seconds=50.91
Timer was signaled: elapsed=50000000, seconds=55.91
Timer was signaled: elapsed=50010000, seconds=00.92
Timer was signaled: elapsed=50010000, seconds=05.93
Timer was signaled: elapsed=50000000, seconds=10.93
Timer was signaled: elapsed=50010000, seconds=15.94
Timer was signaled: elapsed=50010000, seconds=20.95
Timer was signaled: elapsed=50000000, seconds=25.95
Timer was signaled: elapsed=50010000, seconds=30.96
Timer was signaled: elapsed=50010000, seconds=35.97
Timer was signaled: elapsed=50000000, seconds=40.97
Timer was signaled: elapsed=50010000, seconds=45.98
Timer was signaled: elapsed=50010000, seconds=50.99
Timer was signaled: elapsed=50000000, seconds=55.99
Timer was signaled: elapsed=50010000, seconds=00.100
Timer was signaled: elapsed=50010000, seconds=05.101
Timer was signaled: elapsed=50000000, seconds=10.101
Timer was signaled: elapsed=50010000, seconds=15.102
Timer was signaled: elapsed=50010000, seconds=20.103
Timer was signaled: elapsed=50010000, seconds=25.104
Timer was signaled: elapsed=50000000, seconds=30.104
Timer was signaled: elapsed=50010000, seconds=35.105
Timer was signaled: elapsed=50010000, seconds=40.106
Timer was signaled: elapsed=50000000, seconds=45.106
Timer was signaled: elapsed=50010000, seconds=50.107
Timer was signaled: elapsed=50010000, seconds=55.108
Timer was signaled: elapsed=50000000, seconds=00.108
Timer was signaled: elapsed=50010000, seconds=05.109
Timer was signaled: elapsed=50010000, seconds=10.110
Timer was signaled: elapsed=50000000, seconds=15.110
Timer was signaled: elapsed=50010000, seconds=20.111
Timer was signaled: elapsed=50010000, seconds=25.112
Timer was signaled: elapsed=50000000, seconds=30.112
Timer was signaled: elapsed=50010000, seconds=35.113
Timer was signaled: elapsed=50010000, seconds=40.114
Timer was signaled: elapsed=50000000, seconds=45.114
Timer was signaled: elapsed=50010000, seconds=50.115
Timer was signaled: elapsed=50010000, seconds=55.116
Timer was signaled: elapsed=50000000, seconds=00.116
Timer was signaled: elapsed=50010000, seconds=05.117
Timer was signaled: elapsed=50010000, seconds=10.118
Timer was signaled: elapsed=50000000, seconds=15.118
Timer was signaled: elapsed=50010000, seconds=20.119
Timer was signaled: elapsed=50010000, seconds=25.120
Timer was signaled: elapsed=50000000, seconds=30.120
Timer was signaled: elapsed=50010000, seconds=35.121
Timer was signaled: elapsed=50010000, seconds=40.122
Timer was signaled: elapsed=50000000, seconds=45.122
Timer was signaled: elapsed=50010000, seconds=50.123
Timer was signaled: elapsed=50010000, seconds=55.124
Timer was signaled: elapsed=50000000, seconds=00.124
Timer was signaled: elapsed=50010000, seconds=05.125
Timer was signaled: elapsed=50010000, seconds=10.126
Timer was signaled: elapsed=50000000, seconds=15.126
Timer was signaled: elapsed=50010000, seconds=20.127
Timer was signaled: elapsed=50010000, seconds=25.128
Timer was signaled: elapsed=50000000, seconds=30.128
Timer was signaled: elapsed=50000000, seconds=35.128
Timer was signaled: elapsed=50000000, seconds=40.128
Timer was signaled: elapsed=50010000, seconds=45.129
Timer was signaled: elapsed=50000000, seconds=50.129
Timer was signaled: elapsed=50000000, seconds=55.129
Timer was signaled: elapsed=50000000, seconds=00.129
Timer was signaled: elapsed=50000000, seconds=05.129
Timer was signaled: elapsed=50000000, seconds=10.129
Timer was signaled: elapsed=50010000, seconds=15.130
Timer was signaled: elapsed=50000000, seconds=20.130
Timer was signaled: elapsed=50000000, seconds=25.130
Timer was signaled: elapsed=50000000, seconds=30.130
Timer was signaled: elapsed=50000000, seconds=35.130
Timer was signaled: elapsed=50010000, seconds=40.131
Timer was signaled: elapsed=50000000, seconds=45.131
Timer was signaled: elapsed=50000000, seconds=50.131
Timer was signaled: elapsed=50000000, seconds=55.131
Timer was signaled: elapsed=50000000, seconds=00.131
Timer was signaled: elapsed=50010000, seconds=05.132
Timer was signaled: elapsed=50000000, seconds=10.132
Timer was signaled: elapsed=50000000, seconds=15.132
Timer was signaled: elapsed=50000000, seconds=20.132
Timer was signaled: elapsed=50000000, seconds=25.132
Timer was signaled: elapsed=50010000, seconds=30.133
Timer was signaled: elapsed=50000000, seconds=35.133
Timer was signaled: elapsed=50000000, seconds=40.133
Timer was signaled: elapsed=50000000, seconds=45.133
Timer was signaled: elapsed=50000000, seconds=50.133
Timer was signaled: elapsed=50010000, seconds=55.134
Timer was signaled: elapsed=50000000, seconds=00.134
Timer was signaled: elapsed=50000000, seconds=05.134
Timer was signaled: elapsed=50000000, seconds=10.134
Timer was signaled: elapsed=50000000, seconds=15.134
Timer was signaled: elapsed=50000000, seconds=20.134
Timer was signaled: elapsed=50010000, seconds=25.135
Timer was signaled: elapsed=50000000, seconds=30.135
Timer was signaled: elapsed=50000000, seconds=35.135
Timer was signaled: elapsed=50000000, seconds=40.135
Timer was signaled: elapsed=50000000, seconds=45.135
Timer was signaled: elapsed=50010000, seconds=50.136
Timer was signaled: elapsed=50000000, seconds=55.136
Timer was signaled: elapsed=50000000, seconds=00.136
Timer was signaled: elapsed=50000000, seconds=05.136
Timer was signaled: elapsed=50000000, seconds=10.136
Timer was signaled: elapsed=50010000, seconds=15.137
Timer was signaled: elapsed=50000000, seconds=20.137
Timer was signaled: elapsed=50000000, seconds=25.137
Timer was signaled: elapsed=50000000, seconds=30.137
Timer was signaled: elapsed=50000000, seconds=35.137
Timer was signaled: elapsed=50010000, seconds=40.138
Timer was signaled: elapsed=50000000, seconds=45.138
Timer was signaled: elapsed=50000000, seconds=50.138
Timer was signaled: elapsed=50000000, seconds=55.138
Timer was signaled: elapsed=50000000, seconds=00.138
Timer was signaled: elapsed=50010000, seconds=05.139
Timer was signaled: elapsed=50000000, seconds=10.139
Timer was signaled: elapsed=50000000, seconds=15.139
Timer was signaled: elapsed=50000000, seconds=20.139
Timer was signaled: elapsed=50000000, seconds=25.139
Timer was signaled: elapsed=50000000, seconds=30.139
Timer was signaled: elapsed=50000000, seconds=35.139
Timer was signaled: elapsed=50000000, seconds=40.139
Timer was signaled: elapsed=50000000, seconds=45.139
Timer was signaled: elapsed=50000000, seconds=50.139
Timer was signaled: elapsed=50000000, seconds=55.139
Timer was signaled: elapsed=50010000, seconds=00.140
Timer was signaled: elapsed=50000000, seconds=05.140
Timer was signaled: elapsed=50000000, seconds=10.140
Timer was signaled: elapsed=50000000, seconds=15.140
Timer was signaled: elapsed=50000000, seconds=20.140
Timer was signaled: elapsed=50000000, seconds=25.140
Timer was signaled: elapsed=50000000, seconds=30.140
Timer was signaled: elapsed=50000000, seconds=35.140
Timer was signaled: elapsed=50000000, seconds=40.140
Timer was signaled: elapsed=50000000, seconds=45.140
Timer was signaled: elapsed=50000000, seconds=50.140
Timer was signaled: elapsed=50000000, seconds=55.140
Timer was signaled: elapsed=50000000, seconds=00.140
Timer was signaled: elapsed=50000000, seconds=05.140
Timer was signaled: elapsed=50000000, seconds=10.140
Timer was signaled: elapsed=50000000, seconds=15.140
Timer was signaled: elapsed=50000000, seconds=20.140
Timer was signaled: elapsed=50000000, seconds=25.140
Timer was signaled: elapsed=50000000, seconds=30.140
Timer was signaled: elapsed=50000000, seconds=35.140
Timer was signaled: elapsed=50000000, seconds=40.140
Timer was signaled: elapsed=50000000, seconds=45.140
Timer was signaled: elapsed=50000000, seconds=50.140
Timer was signaled: elapsed=50000000, seconds=55.140
Timer was signaled: elapsed=50000000, seconds=00.140
Timer was signaled: elapsed=50000000, seconds=05.140
Timer was signaled: elapsed=50000000, seconds=10.140
Timer was signaled: elapsed=50000000, seconds=15.140
Timer was signaled: elapsed=50000000, seconds=20.140
Timer was signaled: elapsed=50000000, seconds=25.140
Timer was signaled: elapsed=50000000, seconds=30.140
Timer was signaled: elapsed=50010000, seconds=35.141
Timer was signaled: elapsed=50000000, seconds=40.141
Timer was signaled: elapsed=50000000, seconds=45.141
Timer was signaled: elapsed=50000000, seconds=50.141
Timer was signaled: elapsed=50000000, seconds=55.141
Timer was signaled: elapsed=50000000, seconds=00.141
Timer was signaled: elapsed=50000000, seconds=05.141
Timer was signaled: elapsed=50000000, seconds=10.141
Timer was signaled: elapsed=50000000, seconds=15.141
Timer was signaled: elapsed=50000000, seconds=20.141
Timer was signaled: elapsed=50000000, seconds=25.141
Timer was signaled: elapsed=50000000, seconds=30.141
Timer was signaled: elapsed=50000000, seconds=35.141
Timer was signaled: elapsed=50000000, seconds=40.141
Timer was signaled: elapsed=50000000, seconds=45.141
Timer was signaled: elapsed=50000000, seconds=50.141
Timer was signaled: elapsed=50000000, seconds=55.141
Timer was signaled: elapsed=50000000, seconds=00.141
Timer was signaled: elapsed=50000000, seconds=05.141
Timer was signaled: elapsed=50000000, seconds=10.141
Timer was signaled: elapsed=50000000, seconds=15.141
Timer was signaled: elapsed=50000000, seconds=20.141
Timer was signaled: elapsed=50000000, seconds=25.141
Timer was signaled: elapsed=50000000, seconds=30.141
Timer was signaled: elapsed=50000000, seconds=35.141
Timer was signaled: elapsed=50000000, seconds=40.141
Timer was signaled: elapsed=50000000, seconds=45.141
Timer was signaled: elapsed=50000000, seconds=50.141
Timer was signaled: elapsed=50000000, seconds=55.141
Timer was signaled: elapsed=50000000, seconds=00.141
Timer was signaled: elapsed=50000000, seconds=05.141
Timer was signaled: elapsed=50000000, seconds=10.141
Timer was signaled: elapsed=50000000, seconds=15.141
Timer was signaled: elapsed=50000000, seconds=20.141
Timer was signaled: elapsed=50000000, seconds=25.141
Timer was signaled: elapsed=50000000, seconds=30.141
Timer was signaled: elapsed=50000000, seconds=35.141
Timer was signaled: elapsed=50000000, seconds=40.141
Timer was signaled: elapsed=50000000, seconds=45.141
Timer was signaled: elapsed=50000000, seconds=50.141
Timer was signaled: elapsed=50000000, seconds=55.141
Timer was signaled: elapsed=50000000, seconds=00.141
Timer was signaled: elapsed=50000000, seconds=05.141
Timer was signaled: elapsed=50000000, seconds=10.141
Timer was signaled: elapsed=50000000, seconds=15.141
Timer was signaled: elapsed=49990000, seconds=20.140
Timer was signaled: elapsed=50000000, seconds=25.140
Timer was signaled: elapsed=50000000, seconds=30.140
Timer was signaled: elapsed=50000000, seconds=35.140
Timer was signaled: elapsed=50000000, seconds=40.140
Timer was signaled: elapsed=50000000, seconds=45.140
Timer was signaled: elapsed=50000000, seconds=50.140
Timer was signaled: elapsed=50000000, seconds=55.140
Timer was signaled: elapsed=50000000, seconds=00.140
Timer was signaled: elapsed=50000000, seconds=05.140
Timer was signaled: elapsed=50000000, seconds=10.140
Timer was signaled: elapsed=50000000, seconds=15.140
Timer was signaled: elapsed=50000000, seconds=20.140
Timer was signaled: elapsed=50000000, seconds=25.140
Timer was signaled: elapsed=50000000, seconds=30.140
Timer was signaled: elapsed=50000000, seconds=35.140
Timer was signaled: elapsed=50000000, seconds=40.140
Timer was signaled: elapsed=50000000, seconds=45.140
Timer was signaled: elapsed=50000000, seconds=50.140
Timer was signaled: elapsed=50000000, seconds=55.140
Timer was signaled: elapsed=50000000, seconds=00.140
Timer was signaled: elapsed=50000000, seconds=05.140
Timer was signaled: elapsed=50000000, seconds=10.140
Timer was signaled: elapsed=50000000, seconds=15.140
Timer was signaled: elapsed=50000000, seconds=20.140
Timer was signaled: elapsed=50000000, seconds=25.140
Timer was signaled: elapsed=50000000, seconds=30.140
Timer was signaled: elapsed=50000000, seconds=35.140
Timer was signaled: elapsed=50000000, seconds=40.140
Timer was signaled: elapsed=50000000, seconds=45.140
Timer was signaled: elapsed=50000000, seconds=50.140
Timer was signaled: elapsed=49990000, seconds=55.139
Timer was signaled: elapsed=50000000, seconds=00.139
Timer was signaled: elapsed=50000000, seconds=05.139
Timer was signaled: elapsed=50000000, seconds=10.139
Timer was signaled: elapsed=50000000, seconds=15.139
Timer was signaled: elapsed=50000000, seconds=20.139
Timer was signaled: elapsed=50000000, seconds=25.139
Timer was signaled: elapsed=50000000, seconds=30.139
Timer was signaled: elapsed=50000000, seconds=35.139
Timer was signaled: elapsed=50000000, seconds=40.139
Timer was signaled: elapsed=50000000, seconds=45.139
Timer was signaled: elapsed=50000000, seconds=50.139
Timer was signaled: elapsed=50000000, seconds=55.139
Timer was signaled: elapsed=50000000, seconds=00.139
Timer was signaled: elapsed=50000000, seconds=05.139
Timer was signaled: elapsed=50000000, seconds=10.139
Timer was signaled: elapsed=50000000, seconds=15.139
Timer was signaled: elapsed=50000000, seconds=20.139
Timer was signaled: elapsed=50000000, seconds=25.139
Timer was signaled: elapsed=49990000, seconds=30.138
Timer was signaled: elapsed=50000000, seconds=35.138
Timer was signaled: elapsed=50000000, seconds=40.138
Timer was signaled: elapsed=50000000, seconds=45.138
Timer was signaled: elapsed=50000000, seconds=50.138
Timer was signaled: elapsed=50000000, seconds=55.138
Timer was signaled: elapsed=50000000, seconds=00.138
Timer was signaled: elapsed=50000000, seconds=05.138
Timer was signaled: elapsed=50000000, seconds=10.138
Timer was signaled: elapsed=50000000, seconds=15.138
Timer was signaled: elapsed=50000000, seconds=20.138
Timer was signaled: elapsed=50000000, seconds=25.138
Timer was signaled: elapsed=50000000, seconds=30.138
Timer was signaled: elapsed=50000000, seconds=35.138
Timer was signaled: elapsed=50000000, seconds=40.138
Timer was signaled: elapsed=50000000, seconds=45.138
Timer was signaled: elapsed=49990000, seconds=50.137
Timer was signaled: elapsed=50000000, seconds=55.137
Timer was signaled: elapsed=50000000, seconds=00.137
Timer was signaled: elapsed=50000000, seconds=05.137
Timer was signaled: elapsed=50000000, seconds=10.137
Timer was signaled: elapsed=50000000, seconds=15.137
Timer was signaled: elapsed=50000000, seconds=20.137
Timer was signaled: elapsed=50000000, seconds=25.137
Timer was signaled: elapsed=50000000, seconds=30.137
Timer was signaled: elapsed=50000000, seconds=35.137
Timer was signaled: elapsed=50000000, seconds=40.137
Timer was signaled: elapsed=50000000, seconds=45.137
Timer was signaled: elapsed=50000000, seconds=50.137
Timer was signaled: elapsed=50000000, seconds=55.137
Timer was signaled: elapsed=50000000, seconds=00.137
Timer was signaled: elapsed=49990000, seconds=05.136
Timer was signaled: elapsed=50000000, seconds=10.136
Timer was signaled: elapsed=50000000, seconds=15.136
Timer was signaled: elapsed=50000000, seconds=20.136
Timer was signaled: elapsed=50000000, seconds=25.136
Timer was signaled: elapsed=50000000, seconds=30.136
Timer was signaled: elapsed=50000000, seconds=35.136
Timer was signaled: elapsed=50000000, seconds=40.136
Timer was signaled: elapsed=50000000, seconds=45.136
Timer was signaled: elapsed=50000000, seconds=50.136
Timer was signaled: elapsed=50000000, seconds=55.136
Timer was signaled: elapsed=50000000, seconds=00.136
Timer was signaled: elapsed=50000000, seconds=05.136
Timer was signaled: elapsed=50000000, seconds=10.136
Timer was signaled: elapsed=50000000, seconds=15.136
Timer was signaled: elapsed=50000000, seconds=20.136
Timer was signaled: elapsed=49990000, seconds=25.135
Timer was signaled: elapsed=50000000, seconds=30.135
Timer was signaled: elapsed=50000000, seconds=35.135
Timer was signaled: elapsed=50000000, seconds=40.135
Timer was signaled: elapsed=50000000, seconds=45.135
Timer was signaled: elapsed=50000000, seconds=50.135
Timer was signaled: elapsed=50000000, seconds=55.135
Timer was signaled: elapsed=50000000, seconds=00.135
Timer was signaled: elapsed=50000000, seconds=05.135
Timer was signaled: elapsed=50000000, seconds=10.135
Timer was signaled: elapsed=50000000, seconds=15.135
Timer was signaled: elapsed=50000000, seconds=20.135
Timer was signaled: elapsed=50000000, seconds=25.135
Timer was signaled: elapsed=50000000, seconds=30.135
Timer was signaled: elapsed=50000000, seconds=35.135
Timer was signaled: elapsed=50000000, seconds=40.135
Timer was signaled: elapsed=49990000, seconds=45.134
Timer was signaled: elapsed=50000000, seconds=50.134
Timer was signaled: elapsed=50000000, seconds=55.134
Timer was signaled: elapsed=50000000, seconds=00.134
Timer was signaled: elapsed=50000000, seconds=05.134
Timer was signaled: elapsed=50000000, seconds=10.134
Timer was signaled: elapsed=50000000, seconds=15.134
Timer was signaled: elapsed=50000000, seconds=20.134
Timer was signaled: elapsed=50000000, seconds=25.134
Timer was signaled: elapsed=50000000, seconds=30.134
Timer was signaled: elapsed=50000000, seconds=35.134
Timer was signaled: elapsed=50000000, seconds=40.134
Timer was signaled: elapsed=50000000, seconds=45.134
Timer was signaled: elapsed=50000000, seconds=50.134
Timer was signaled: elapsed=50000000, seconds=55.134
Timer was signaled: elapsed=49990000, seconds=00.133
Timer was signaled: elapsed=50000000, seconds=05.133
Timer was signaled: elapsed=50000000, seconds=10.133
Timer was signaled: elapsed=50000000, seconds=15.133
Timer was signaled: elapsed=50000000, seconds=20.133
Timer was signaled: elapsed=50000000, seconds=25.133
Timer was signaled: elapsed=50000000, seconds=30.133
Timer was signaled: elapsed=50000000, seconds=35.133
Timer was signaled: elapsed=50000000, seconds=40.133
Timer was signaled: elapsed=50000000, seconds=45.133
Timer was signaled: elapsed=50000000, seconds=50.133
Timer was signaled: elapsed=50000000, seconds=55.133
Timer was signaled: elapsed=50000000, seconds=00.133
Timer was signaled: elapsed=50000000, seconds=05.133
Timer was signaled: elapsed=50000000, seconds=10.133
Timer was signaled: elapsed=50000000, seconds=15.133
Timer was signaled: elapsed=49990000, seconds=20.132
Timer was signaled: elapsed=50000000, seconds=25.132
Timer was signaled: elapsed=50000000, seconds=30.132
Timer was signaled: elapsed=50000000, seconds=35.132
Timer was signaled: elapsed=50000000, seconds=40.132
Timer was signaled: elapsed=50000000, seconds=45.132
Timer was signaled: elapsed=50000000, seconds=50.132
Timer was signaled: elapsed=50000000, seconds=55.132
Timer was signaled: elapsed=50000000, seconds=00.132
Timer was signaled: elapsed=50000000, seconds=05.132
Timer was signaled: elapsed=50000000, seconds=10.132
Timer was signaled: elapsed=50000000, seconds=15.132
Timer was signaled: elapsed=50000000, seconds=20.132
Timer was signaled: elapsed=50000000, seconds=25.132
Timer was signaled: elapsed=50000000, seconds=30.132
Timer was signaled: elapsed=49990000, seconds=35.131
Timer was signaled: elapsed=50000000, seconds=40.131
Timer was signaled: elapsed=50000000, seconds=45.131
Timer was signaled: elapsed=50000000, seconds=50.131
Timer was signaled: elapsed=50000000, seconds=55.131
Timer was signaled: elapsed=50000000, seconds=00.131
Резюме : На самом деле я не знаю, что делать с этими результатами. Это выглядит как будто Windows пытается активно исправить любое отклонение в таймере, так что каждое пробуждение происходит в «подходящее» время. Если это так, то это (установка одного таймера на нужный вам интервал), безусловно, самый простой способ достичь желаемого.