Use time_since() and time_until() instead of open-coded variants

Use these helpers in the places where we're calling get_time() and
comparing it against a single struct timeval.
This commit is contained in:
Kevin Easton
2015-05-14 00:02:51 +10:00
parent f1c27a4f64
commit af017816e2
3 changed files with 6 additions and 15 deletions

View File

@@ -822,14 +822,12 @@ static void p_quit(char *from, char **ArgList)
static int sping_reply(char *from, char *sping_dest, int server)
{
char buff[50];
struct timeval timenow;
Sping *tmp = get_server_sping(server, sping_dest);
if (!tmp)
return 0;
get_time(&timenow);
snprintf(buff, sizeof buff, "%2.4f", BX_time_diff(tmp->in_sping, timenow));
snprintf(buff, sizeof buff, "%2.4f", time_since(&tmp->in_sping));
reset_display_target();
put_it("%s", convert_output_format("$G Server pong from %W$0%n $1 seconds", "%s %s", from, buff));