rdtsc: Difference between revisions

From vegard.wiki
Jump to navigation Jump to search
Content added Content deleted
(new page)
 
(add link)
 
Line 9: Line 9:
}
}
</source>
</source>

=== See also ===

* https://stackoverflow.com/questions/9887839/how-to-count-clock-cycles-with-rdtsc-in-gcc-x86/9887979


[[Category:Programming]]
[[Category:Programming]]

Latest revision as of 12:01, 1 March 2020

static inline uint64_t rdtsc(void)
{
        uint32_t a;
        uint32_t d;
        asm volatile ("rdtsc" : "=a" (a), "=d" (d));

        return (uint64_t) a | ((uint64_t) d << 32);
}

See also