mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 10:15:57 +01:00
readme: document rdtsc
This commit is contained in:
@@ -16,11 +16,10 @@ Only works in x86_64.
|
||||
int main(void) {
|
||||
uintmax_t val;
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
/* https://stackoverflow.com/questions/9887839/clock-cycle-count-wth-gcc/9887979 */
|
||||
val = __rdtsc();
|
||||
#else
|
||||
val = 0;
|
||||
#endif
|
||||
printf("%jx\n", val);
|
||||
printf("%ju\n", val);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user