added lib files
[nao-ulib.git] / src / ticks_x86.h
blobfe7ecd58fd2e50a56353d84dec551330eb3693ed
1 /*
2 * nao-ulib
3 * Copyright 2011 Daniel Borkmann <dborkma@tik.ee.ethz.ch>
4 * Subject to the GPL.
5 * Nao-Team HTWK,
6 * Faculty of Computer Science, Mathematics and Natural Sciences,
7 * Leipzig University of Applied Sciences (HTWK Leipzig)
8 */
10 #ifndef TICKS_X86
11 #define TICKS_X86
14 * Generate 64-bit timestamp.
17 static unsigned long long getticks(void)
19 unsigned int __a,__d;
21 __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d));
22 return ((long long)__a) | (((long long)__d)<<32);
25 #endif /* TICKS_X86 */