13 #ifdef HAVE_SYS_SELECT_H
14 #include <sys/select.h>
18 /* gets current time in microseconds */
19 unsigned long_long
get_time(void)
25 memset(&tz
,0,sizeof(tz
));
26 gettimeofday(&tv
,&tz
);
27 return ((unsigned long_long
)tv
.tv_sec
)*1000000+(unsigned long_long
)tv
.tv_usec
;
29 return ((unsigned long_long
)GetTickCount())*1000UL;
34 /* waits until time t passes */
35 void sleep_until(unsigned long_long t
)
37 unsigned long_long u
=get_time();
43 Sleep((DWORD
)(t
/1000));
44 #elif defined(__EMX__)
52 select(0,NULL
,NULL
,NULL
,&tv
);
58 /* waits time t microseconds */
59 void my_sleep(unsigned long_long t
)
62 Sleep((DWORD
)(t
/1000));
63 #elif defined(__EMX__)
71 select(0,NULL
,NULL
,NULL
,&tv
);