/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* time.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/10/17 15:31:00 by fgras-ca #+# #+# */ /* Updated: 2023/10/17 16:20:32 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ #include "philo.h" long initialize_start_time(void) { struct timeval now; gettimeofday(&now, NULL); return ((now.tv_sec * 1000) + (now.tv_usec / 1000)); } long get_time(long start_time) { struct timeval now; gettimeofday(&now, NULL); return (((now.tv_sec * 1000) + (now.tv_usec / 1000)) - start_time); }