Path: blob/main/cad/graywolf/files/patch-src_Ylib_timer.c
18160 views
--- src/Ylib/timer.c.orig 2018-08-23 20:02:57 UTC1+++ src/Ylib/timer.c2@@ -58,6 +58,23 @@ REVISIONS:3#include <sys/timeb.h>4#endif /* SYS5 */56+#include <sys/time.h>7+8+// from /usr/src/lib/libcompat/4.1/ftime.c9+int ftime(struct timeb *tbp) {10+ struct timezone tz;11+ struct timeval t;12+13+ if (gettimeofday(&t, &tz) < 0)14+ return (-1);15+ tbp->millitm = t.tv_usec / 1000;16+ tbp->time = t.tv_sec;17+ tbp->timezone = tz.tz_minuteswest;18+ tbp->dstflag = tz.tz_dsttime;19+20+ return (0);21+}22+23static INT base_timeS = 0 ; /* the time in seconds at the start */24static INT milli_timeS ; /* the millisecond part of the start */25/* initialize the timer */262728