[fpc-devel] NowUTC in the RTL

Tomas Hajny XHajT03 at hajny.biz
Fri Dec 9 15:44:45 CET 2011


On Fri, December 9, 2011 13:17, Felipe Monteiro de Carvalho wrote:
> 2011/12/9 Tomas Hajny <XHajT03 at hajny.biz>:
>> Is it preferred to return ticks (dependent on various stuff), or
>> something
>> like GetMsCount (as already existing in unit Dos)?
>
> I would like to define it like this:
>
> "FPGetTickCount returns the amount of ticks since an unspecified
> initial time. This initial time is unknown, but is fixed for the
> entire duration of the application. Ticks are time intervals and all
> of them have the same duration, but their exact meaning in terms of
> real world units like milliseconds is unspecified. FPGetTickCount is
> not affected by timezones and also not by the user changing the system
> clock."
>
> So it matches Windows.GetTickCount well but still is flexible enough
> to be implemented in other platforms.
 .
 .

Is this "time fixed for the entire duration of the application" available
on all platforms (especially considering the HW point of view now)?

Wouldn't the use be limited by the fact that the length of time is not
specified at all? You cannot use it for measuring of time intervals any
longer then, e.g. stuff like check if the period of time between two
events was at least X (that was the reason for implementing Dos.GetMsCount
some time ago) or measuring that certain procedure took Y. There's also a
risk that users will start using it that way anyway based on assumptions
from x86 is probably the worst thing resulting in unportable code.

Tomas





More information about the fpc-devel mailing list