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

@@ -84,6 +84,8 @@ int lw_strcmp (comp_func *, char *, char *);
int open_to (char *, int, off_t);
struct timeval BX_get_time (struct timeval *);
double BX_time_diff (struct timeval, struct timeval);
double time_since(const struct timeval *tv_from);
double time_until(const struct timeval *tv_to);
char * BX_plural (int);
int BX_time_to_next_minute (void);
char * BX_remove_trailing_spaces (char *);