reorganisation structs et timestamp global

This commit is contained in:
Hugo LAMY
2022-01-22 12:41:30 +01:00
parent 6a4aad9503
commit 3ba76ccc4e
5 changed files with 34 additions and 28 deletions

View File

@@ -4,9 +4,12 @@ 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;
if (philo->params->t_start_s == 0)
{
gettimeofday(&stime, NULL);
philo->params->t_start_s = stime.tv_sec;
philo->params->t_start_u = stime.tv_usec;
}
}
void update_time(t_philo *philo)