aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-02-15 01:47:26 +0100
committerCharles <sircharlesaze@gmail.com>2020-02-15 01:47:26 +0100
commit2c5abe421b7a1b92081e38f6b1f04d407fcba834 (patch)
treec7e7aa9db3a3b84bd80bc8a5a713d5bfeb6a66f7 /common
parent6a1e91750ee43fccb6160af0f44139698c8dfdc3 (diff)
downloadphilosophers-2c5abe421b7a1b92081e38f6b1f04d407fcba834.tar.gz
philosophers-2c5abe421b7a1b92081e38f6b1f04d407fcba834.tar.bz2
philosophers-2c5abe421b7a1b92081e38f6b1f04d407fcba834.zip
philo_one small refactoring, philo_three draft
Diffstat (limited to 'common')
-rw-r--r--common/common.c9
-rw-r--r--common/helper.c2
2 files changed, 3 insertions, 8 deletions
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 <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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)
diff --git a/common/helper.c b/common/helper.c
index 2826ceb..7799a0c 100644
--- a/common/helper.c
+++ b/common/helper.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/08 23:22:49 by cacharle #+# #+# */
-/* Updated: 2020/02/14 21:07:54 by cacharle ### ########.fr */
+/* Updated: 2020/02/15 00:53:47 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */