Introduce time_offset() helper and replace open-coded versions in timer.c

This function takes a struct timeval and offsets it by a (potentially fractional)
number of seconds, given as a 'double'.
This commit is contained in:
Kevin Easton
2017-09-20 23:07:52 +10:00
parent 604fcf794b
commit bbd18ba47e
3 changed files with 47 additions and 50 deletions

View File

@@ -74,6 +74,7 @@ double BX_time_diff (struct timeval, struct timeval);
double time_since(const struct timeval *tv_from);
double time_until(const struct timeval *tv_to);
int time_cmp(const struct timeval *a, const struct timeval *b);
struct timeval *time_offset(struct timeval *tv, double offset);
char * BX_plural (int);
int BX_time_to_next_minute (void);
char * BX_remove_trailing_spaces (char *);