xref: /haiku/src/system/libroot/posix/time/clock.cpp (revision 3dfd9cb95ce45f59160d50975210bc55e3fc0709)
1 /*
2  * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <time.h>
8 #include <OS.h>
9 
10 #include <symbol_versioning.h>
11 
12 #include <time_private.h>
13 
14 
15 clock_t
16 __clock_beos(void)
17 {
18 	thread_info info;
19 	get_thread_info(find_thread(NULL), &info);
20 
21 	return (clock_t)((info.kernel_time + info.user_time)
22 		/ MICROSECONDS_PER_CLOCK_TICK_BEOS);
23 }
24 
25 
26 clock_t
27 __clock(void)
28 {
29 	thread_info info;
30 	get_thread_info(find_thread(NULL), &info);
31 
32 	return (clock_t)((info.kernel_time + info.user_time)
33 		/ MICROSECONDS_PER_CLOCK_TICK);
34 }
35 
36 
37 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__clock_beos", "clock@", "BASE");
38 
39 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__clock", "clock@@", "1_ALPHA4");
40