xref: /haiku/src/libs/compat/freebsd_network/clock.c (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1 /*
2  * Copyright 2018, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include <OS.h>
7 #include <compat/sys/kernel.h>
8 #include <compat/sys/time.h>
9 
10 
11 int32_t
12 _get_ticks()
13 {
14 	return USEC_2_TICKS(system_time());
15 }
16 
17 
18 void
19 getmicrouptime(struct timeval *tvp)
20 {
21 	bigtime_t usecs = system_time();
22 	tvp->tv_sec = usecs / 1000000;
23 	tvp->tv_usec = usecs % 1000000;
24 }
25