1
0
This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
philosopher/philo/get_time_in_ms.c
2024-07-25 16:13:23 +02:00

22 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_time_in_ms.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/09 12:02:24 by adjoly #+# #+# */
/* Updated: 2024/07/24 23:51:20 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include <sys/time.h>
#include <stdint.h>
#include "philo.h"
uint16_t get_time_in_ms(struct timeval t0, struct timeval t1)
{
return (((t1.tv_sec - t0.tv_sec) * 1000000 + \
t1.tv_usec - t0.tv_usec) / 1000);
}