[fpc-devel] About GetTickCount

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Nov 4 08:46:11 CET 2011


On 3 November 2011 15:55,  wrote:
>
> PLEASE NEVER MENTION EPIKTIMER AGAIN.
>
> it returns Now() on all platforms except i386.

Not sure if my version of EpikTimer is the same as yours. Last time we
had this (similar) conversation, your EpikTimer code was out of date
(you still had code which required LCL to use EpikTimer).

EpikTimer can use RDTSC under i386, because that is where it was still
reliable. With todays multi-cpu, multi-core, power saving modes and
hyper-boost features the TSC is not reliable any more. So EpikTimer
also uses the Windows APIs QueryPerformanceCounter and
QueryPerformanceFrequency under Windows (x86 & x86_64). Under Linux it
was suggested, to get similar functionality as the Windows API calls,
by reading the value of CLOCK_MONOTONIC clock using POSIX
clock_gettime function [1]. My version of EpikTimer use the
fpgettimeofday() call under Linux for clock ticks. I haven't
investigated in detail what that call translates too under Linux - I
hope it's not Now().


[1]
    http://en.wikipedia.org/wiki/Time_Stamp_Counter


So I really don't know why you are so harsh on EpikTimer, it is not
nearly as bad as you paint it to be.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net



More information about the fpc-devel mailing list