debut implementation death tout est casse

This commit is contained in:
Hugo LAMY
2022-01-21 18:32:37 +01:00
parent be439700e9
commit 6a4aad9503
12 changed files with 107 additions and 214 deletions

19
srcs/time.c Normal file
View File

@@ -0,0 +1,19 @@
#include "philo.h"
void init_time(t_philo *philo)
{
struct timeval stime;
gettimeofday(&stime, NULL);
philo->t_start_s = stime.tv_sec;
philo->t_start_u = stime.tv_usec;
}
void update_time(t_philo *philo)
{
struct timeval stime;
gettimeofday(&stime, NULL);
philo->t_last_meal_s = stime.tv_sec;
philo->t_last_meal_u = stime.tv_usec;
}