22#include "../utils/utils.h" 
   40    while (!stopped && (
timestamp() - start) < ms)
 
   42        stopped = usleep(200);
 
   44            stopped = 
stop(thread);
 
   46    return (stopped || 
check_end(thread->global));
 
 
int check_end(t_global *global)
Check if the simulation has ended.
 
int stop(t_thread *thread)
Determine if this thread's philo should die, or if the thread has reported an error.
 
int philo_sleep(unsigned long ms, t_thread *thread)
Sleep in 200 microsecond intervals until ms millis have elapsed, or stop has returned non-zero.
 
unsigned long timestamp(void)
Millisecond timestamp since this function was first called.