commit 89fb50d2c2680c2b2e6c3e922b84d259e451c853 parent cb76359a23b69aab1b2048a3a84385749cf0bec0 Author: Yersa Nordman <yersa@finwo.nl> Date: Sun, 22 Oct 2023 20:57:46 +0200 Replaced gettimeofday by timeb/ftime Diffstat:
| M | src/fnet.c | | | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/fnet.c b/src/fnet.c @@ -6,7 +6,7 @@ extern "C" { #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/time.h> +#include <sys/timeb.h> #include <fcntl.h> #include <sys/types.h> @@ -73,9 +73,9 @@ int setnonblock(int fd) { } int64_t _fnet_now() { - struct timeval tv; - gettimeofday(&tv, NULL); - return (tv.tv_sec * ((int64_t)1000)) + (tv.tv_usec / 1000); + struct timeb tb; + ftime(&tb); + return (1000 * (int64_t)tb.time) + tb.millitm; } // CAUTION: assumes options have been vetted