On Wed, May 28, 2014 at 05:41:08PM +0200, Marco van de Voort wrote:
> In our previous episode, Henry Vermaak said:
> > On linux, The TSC gets calibrated and the synchronisation is tested, which
> > may result in the TSC clock source being marked as unstable and disabled. 
> > In this case, it will fall back to using other clock sources (HPET is next
> > in line on my computer).
> 
> I assume the same system underlies queryperformancecounter and family on
> Windows. But that means you need to use OS timing functions, and not ASM.

I assumed that, too.  All the clocksource calibration and selection
happens at startup, so by the time you call
clock_gettime()/QueryPerformanceCounter() it knows whether to query the
TSC/HPET/whatever.

Blindly making assumptions about TSC stability can get you into trouble.
Microsoft advises against this, too:

http://msdn.microsoft.com/en-gb/library/windows/desktop/ee417693%28v=vs.85%29.aspx

Henry
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to