Do you want your program to do other things in the meantime? If you do, then put the alert messages in another thread, but your compiler may not support multi-threaded programs. So an alternative might be to use a loop
time_t t1, t2; // time variables
double dif;
t1 = time(0); // get current time
while(true)
{
t2 = time(0);
dif = diftime(t2,t1);
if( dif >= (double)(15 * 60) ) // if 15 minutes expired
{
// display alert message
//
// reset timer
t1 = t2;
}
// do other stuff here
}
Ancient Dragon
Achieved Level 70
32,275 posts since Aug 2005
Reputation Points: 5,852
Solved Threads: 2,590
Skill Endorsements: 70
Question Answered as of 1 Year Ago by
Ancient Dragon