use the -newos toolchain even if -elf is present.
[newos.git] / apps / testapp / misctests.cpp
blob1f4f9bdb02b40cbd987b2ffb278c053b7992d7da
1 /*
2 ** Copyright 2004, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #include <string.h>
6 #include <stdio.h>
7 #include <unistd.h>
8 #include <sys/syscalls.h>
10 int syscall_bench(int arg)
12 bigtime_t start_time = _kern_system_time();
13 int i;
14 const int count = 250000;
16 for(i=0; i < count; i++) {
17 _kern_null();
20 start_time = _kern_system_time() - start_time;
22 printf("took %Ld usecs to call _kern_null() %d times (%Ld usecs/call)\n",
23 start_time, count, start_time/count);
24 printf("%Ld cycles/syscall on 500 Mhz cpu\n", start_time * 500 / count);
26 return 0;