-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_msleep.c
25 lines (22 loc) · 1.05 KB
/
ft_msleep.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_msleep.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ykoh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/03/15 02:56:48 by ykoh #+# #+# */
/* Updated: 2021/03/15 02:57:06 by ykoh ### ########.fr */
/* */
/* ************************************************************************** */
#include "philo_one.h"
void ft_msleep(time_t millisecond)
{
const time_t base = get_time();
while (1)
{
if (millisecond < get_time() - base)
return ;
usleep(USLEEP);
}
}