show ping response lines and stats lines
This commit is contained in:
14
srcs/utils.c
14
srcs/utils.c
@ -6,7 +6,7 @@
|
||||
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/26 17:03:11 by tomoron #+# #+# */
|
||||
/* Updated: 2025/04/26 17:08:08 by tomoron ### ########.fr */
|
||||
/* Updated: 2025/05/02 01:07:37 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
#include "includes/ft_ping.h"
|
||||
@ -37,9 +37,19 @@ void free_hosts(t_host_list *list)
|
||||
|
||||
while(list)
|
||||
{
|
||||
printf("free : %s\n", list->host);
|
||||
tmp = list->next;
|
||||
free(list);
|
||||
list = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
double timediff(struct timeval *from)
|
||||
{
|
||||
struct timeval now;
|
||||
float diff;
|
||||
|
||||
gettimeofday(&now, 0);
|
||||
diff = ((double)now.tv_sec - from->tv_sec);
|
||||
diff += (((double)now.tv_usec / 1000000) - ((double)from->tv_usec / 1000000));
|
||||
return(diff);
|
||||
}
|
||||
|
Reference in New Issue
Block a user