On Wed, Aug 15, 2012 at 13:25, Ted Unangst wrote: I will probably rename this just "tsc" after some prodding from mikeb, that's a better name. I tend to focus on the instruction used, but we should name it after the counter.
> + rdtsc_timecounter.tc_frequency = cpuspeed; > + /* cpuspeed is scaled down, so for now, we do the same */ > + tsc = rdtsc(); > + tsc /= 1000000; > + return (uint32_t)tsc; This I know is suboptimal. We need to scale down some, to avoid overflow, but a factor of 1000 is probably better. Or 1024 and shift for more speeds.
