останавливается
                  
                  
                  #include "stdafx.h"
                  
                  
                  #include <Windows.h>
                  
                  
                  #include <iostream>
                  
                  
                  #pragma comment(lib, "Winmm.lib")
                  
                  
                  
                  
                  
                  
                  
                  
                  const unsigned int t1 = 6900;
                  
                  
                  const unsigned int t2 = 3700;
                  
                  
                  const unsigned int t3 = 2900;
                  
                  
                  
                  
                  
                  const unsigned int r1 = 10;
                  
                  
                  const unsigned int r2 = 35;
                  
                  
                  //const unsigned int r3;
                  
                  
                  
                  
                  
                  
                  
                  
                  void CALLBACK n_one(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2)
                  
                  
                  {
                  
                  
                    int i, j;
                  
                  
                  
                  
                  
                    i = 1 + rand() % 30;
                  
                  
                    j = GetTickCount();
                  
                  
                  
                  
                  
                    while (GetTickCount() - j < i)
                  
                  
                    {
                  
                  
                    }
                  
                  
                  
                  
                  
                    std::cout << "One\n";
                  
                  
                  }
                  
                  
                  
                  
                  
                  
                  
                  
                  int main()
                  
                  
                  {
                  
                  
                    int one = timeSetEvent(t1, r1, n_one, NULL, TIME_PERIODIC);
                  
                  
                  
                  
                  
                    //timeKillEvent(one);
                  
                  
                      return 0;
                  
                  
                  }
                  
                  
                
нет цикла обработки сообщений, без которых таймер работать не будет
Обсуждают сегодня