summaryrefslogtreecommitdiff
path: root/src/common/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/timer.c')
-rw-r--r--src/common/timer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/timer.c b/src/common/timer.c
index 5f1f17e2f..c66fd5960 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -91,8 +91,12 @@ char* search_timer_func_list(TimerFunc func)
/// platform-abstracted tick retrieval
static unsigned int tick(void)
{
-#ifdef WIN32
+#if defined(WIN32)
return GetTickCount();
+#elif defined(__FREEBSD__)
+ struct timespec tval;
+ clock_gettime(CLOCK_MONOTONIC, &tval);
+ return tval.tv_sec * 1000 + tval.tv_nsec / 1000000;
#else
struct timeval tval;
gettimeofday(&tval, NULL);