I'm far from a great source of advice, but I think this timer class that I wrote once might help:
class Timer
{
time_t time1_o;
time_t time2_o;
time_t temp1;
time_t temp2;
public:
//Timer ( ) { cout << "Object Timer constructed. . .n"; }
//~Timer ( ) { cout << "Object Timer destroyed. . .n"; }
void set_time1 ( ) { time ( &time1_o ); }
void set_time2 ( ) { time ( &time2_o ); }
time_t get_time1 ( ) { return time1_o; }
time_t get_time2 ( ) { return time2_o; }
void wait ( double seconds )
{
time ( &temp1 );
for ( ; ; )
{
time ( &temp2 );
if ( difftime ( temp2, temp1 ) >= seconds )
break;
}
}
};
Of course, it also could be a complete waste of a post. Who knows.