Loop causes "not responding"

hey Guys got a loop here that make the program go into a not responding state
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bool SetTime(const int hour,const int min,HWND sec)
{
do 
{
  time_t s=time(0);  
  tm t=*localtime(&s);
  itoa(t.tm_sec,buf3,10);
  SetWindowText(sec,buf3);
  if (hour == t.tm_hour && min == t.tm_min)
    {
           exit(0);
               
     }
     Sleep(1000);
     }
 while( hour == t.tm_hour && min >t.tm_min);
     }

code is for a alarm clock, uses default windows GUI
Topic archived. No new replies allowed.