int prev_time;
struct timeval tv;
while( 1 )
{
gettimeofday( &tv, NULL );
if( ((tv.tv_usec) - prev_time) < MIN_DELAY )
{
prev_time = (tv.tv_usec);
MainGameLoop();
}
}
(MIN_DELAY is the minimum microseconds between each game cycle)
I'm not sure if the tv.u_sec is microseconds from current second, or total microseconds seconds since Jan 1st 1970...
do a man gettimeofday...
------------------
Mark Collnis
- EHB Software
[This message has been edited by Godfree^ (edited August 24, 1999).]