Skip to contentSkip to conversation

Emulate RDTSC

DISCUSSION Jaswinder Singh 2 participants 2 messages May 30, 2001

lore
Share & tools
lore
#0 lore raw

Hi all,

What is the nice way (in accuracy and performance) to emulate RDTSC in Linux for those architectures who dont support RDTSC like in Hitachi SH Processors.

Thank you,

Best Regards,

Jaswinder.
--
These are my opinions not 3Di.

#1 lore raw
Quoted 3 lines · Jaswinder Singh

What is the nice way (in accuracy and performance) to emulate RDTSC in Linux for those architectures who dont support RDTSC like in Hitachi SH Processors.

if the hardware provides no way to get some accurate estimation of current time, then there is no way to solve this problem in a generic way. Typically there are some cycle-accuracy counters in the CPU (ideal situation), or sometimes there is a counter in some external device (eg. the i8254 timer counter), but access to these tend to be slow and typically they are quite coarse as well.

Ingo