Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yabtaour
GitHub Repository: yabtaour/Philosophers-42
Path: blob/master/philo_bonus/ft_timestamp_bonus.c
882 views
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_timestamp_bonus.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: yabtaour <[email protected]> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2022/05/23 00:08:36 by yabtaour #+# #+# */
9
/* Updated: 2022/05/23 00:08:38 by yabtaour ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
#include "philosophers_bonus.h"
13
14
long long ft_timestamp(void)
15
{
16
struct timeval te;
17
long long milliseconds;
18
19
gettimeofday(&te, NULL);
20
milliseconds = ((te.tv_sec * 1000) + te.tv_usec / 1000);
21
return (milliseconds);
22
}
23
24