projects
/
userspace-rcu.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Add ia64 architecture based on gcc primitives
[userspace-rcu.git]
/
tests
/
test_cycles_per_loop.c
1
#include <urcu/arch.h>
2
#include <stdio.h>
3
4
#define NR_LOOPS 1000000UL
5
6
static
inline
void
loop_sleep
(
unsigned long
l
)
7
{
8
while
(
l
-- !=
0
)
9
cpu_relax
();
10
}
11
12
int
main
()
13
{
14
cycles_t time1
,
time2
;
15
16
time1
=
get_cycles
();
17
loop_sleep
(
NR_LOOPS
);
18
time2
=
get_cycles
();
19
printf
(
"CPU clock cycles per loop: %g
\n
"
, (
time2
-
time1
) /
20
(
double
)
NR_LOOPS
);
21
}
This page took
0.029305 seconds
and
4
git commands to generate.