From 2c5abe421b7a1b92081e38f6b1f04d407fcba834 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 15 Feb 2020 01:47:26 +0100 Subject: philo_one small refactoring, philo_three draft --- common/common.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'common/common.c') diff --git a/common/common.c b/common/common.c index 381256b..face0b5 100644 --- a/common/common.c +++ b/common/common.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/08 23:12:55 by cacharle #+# #+# */ -/* Updated: 2020/02/14 19:42:18 by cacharle ### ########.fr */ +/* Updated: 2020/02/15 00:54:03 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -33,12 +33,7 @@ t_bool parse_args(t_philo_args *philo_args, int argc, char **argv) void philo_put_state_change(int id, t_philo_event event) // not correct for philo3 { - struct timeval tv; - - if (gettimeofday(&tv, NULL) == -1) - return ; - h_putnbr(tv.tv_sec); - h_putnbr(tv.tv_usec / 1000); + h_putnbr(h_time_now()); h_putchar(' '); h_putnbr(id); if (event == EVENT_FORK) -- cgit