btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / tests / system / kernel / syscall_time.cpp
blob6a7296a14fb7287ba5d7fb4d16822e0078f95776
1 /*
2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <OS.h>
8 #include <stdio.h>
10 #ifdef __HAIKU__
11 # include <syscalls.h>
12 #endif
15 int
16 main(int argc, char **argv)
18 const int32 loops = 100000;
19 bigtime_t startTime = system_time();
21 for (int32 i = 0; i < loops; i++) {
22 #ifdef __HAIKU__
23 _kern_is_computer_on();
24 #else
25 is_computer_on();
26 #endif
29 bigtime_t runTime = system_time() - startTime;
31 // empty loop time
33 startTime = system_time();
35 for (int32 i = 0; i < loops; i++)
38 runTime -= system_time() - startTime;
40 printf("%f usecs/syscall\n", 1.0 * runTime / loops);
41 return 0;