blob: 843a19ace9ea64ff884a34a98e4c9c101bb85b4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <stdio.h>
#include <camellia/syscalls.h>
#include <x86intrin.h>
#define NUM_RUNS 4
#define NUM_CALLS 512
int main(void) {
uint64_t time;
uint64_t results[8];
for (int i = 0; i < NUM_RUNS; i++) {
time = __rdtsc();
for (int j = 0; j < NUM_CALLS; j++)
_syscall_write(1, ".", 1, -1, 0);
_syscall_write(1, "\n", 1, -1, 0);
results[i] = __rdtsc() - time;
}
for (int i = 0; i < NUM_RUNS; i++) {
printf("run %x: %x\n", i, results[i] / 3000);
}
return 0;
}
|