projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a5fbe2
)
bench: use CLOCK_MONOTONIC
author
nsz
<nsz@port70.net>
Thu, 28 Jul 2011 23:21:02 +0000
(
01:21
+0200)
committer
nsz
<nsz@port70.net>
Thu, 28 Jul 2011 23:21:02 +0000
(
01:21
+0200)
common/bench.c
patch
|
blob
|
history
diff --git
a/common/bench.c
b/common/bench.c
index
2e1ace5
..
4c4d118
100644
(file)
--- a/
common/bench.c
+++ b/
common/bench.c
@@
-29,15
+29,7
@@
static unsigned long long nsclock() {
struct timespec ts;
int r;
-#ifdef _POSIX_CPUTIME
- r = clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
-#else
-#ifdef _POSIX_MONOTONIC_CLOCK
r = clock_gettime(CLOCK_MONOTONIC, &ts);
-#else
- r = clock_gettime(CLOCK_REALTIME, &ts);
-#endif
-#endif
if (r < 0) {
fprintf(stderr, "bench: clock_gettime failed: %s\n", strerror(errno));
return 0;