btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / tests / system / kernel / path_resolution_test.cpp
blob78d7776bc1f157ed308f706f4a72c1b32723f579
1 /*
2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
6 #include <stdio.h>
7 #include <sys/stat.h>
9 #include <OS.h>
12 static void
13 time_lstat(const char* path)
15 printf("%-60s ...", path);
16 fflush(stdout);
17 bigtime_t startTime = system_time();
19 static const int32 iterations = 10000;
20 for (int32 i = 0; i < iterations; i++) {
21 struct stat st;
22 lstat(path, &st);
25 bigtime_t totalTime = system_time() - startTime;
26 printf(" %5.3f us/call\n", (double)totalTime / iterations);
30 int
31 main()
33 const char* const paths[] = {
34 "/",
35 "/boot",
36 "/boot/develop",
37 "/boot/develop/headers",
38 "/boot/develop/headers/posix",
39 "/boot/develop/headers/posix/sys",
40 "/boot/develop/headers/posix/sys/stat.h",
41 NULL
44 for (int32 i = 0; paths[i] != NULL; i++)
45 time_lstat(paths[i]);
47 return 0;