Add time_until() and time_since() utility functions

Adding these in preparation for converting server->connect_time from time_t
to struct timeval.  Also converts three existing open-coded versions over to
the new functions.
This commit is contained in:
Kevin Easton
2015-05-13 21:50:30 +10:00
parent 0f8280ed51
commit 4ee6c6295b
4 changed files with 23 additions and 3 deletions

View File

@@ -5531,7 +5531,7 @@ struct timeval start;
* with the arguments.
*/
add_timer(0, empty_string, milliseconds, 1, (int (*)(void *, char *))comment, NULL, NULL, get_current_winref(), "pause");
while (BX_time_diff(get_time(NULL), start) > 0)
while (time_until(&start) > 0)
io("e_pause");
}