Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yabtaour
GitHub Repository: yabtaour/Philosophers-42
Path: blob/master/philo/ft_timestamp.c
882 views
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_timestamp.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: yabtaour <[email protected]> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2022/05/19 22:15:54 by yabtaour #+# #+# */
9
/* Updated: 2022/05/19 22:25:32 by yabtaour ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
#include "philosophers.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