philosophers/philo/src/utils/think_time.c
2025-01-29 00:19:27 +01:00

22 lines
1.0 KiB
C

/* ************************************************************************** */
/* */
/* ::: o_ :::::: ::: */
/* think_time.c :+: / :+::+: :+: */
/* +:+ > +:++:+ +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#++#++:++#++ */
/* +#+ +#+#+ +#++#+ +#+ \o/ */
/* Created: 2025/01/28 17:29:47 by whaffman #+#+# #+#+# #+# #+# | */
/* Updated: 2025/01/28 17:29:47 by whaffman ### ### ### ### / \ */
/* */
/* ************************************************************************** */
#include "philo.h"
int think_time(t_rules *rules)
{
int res;
res = (rules->time_to_die - rules->time_to_eat - rules->time_to_sleep) / 5;
return (res);
}