[Lazarus] Portable way to get accurate timestamps?

Marco van de Voort marcov at stack.nl
Sat Feb 26 19:43:16 CET 2011


On Sat, Feb 26, 2011 at 07:19:52PM +0100, Luca Olivetti wrote:
> > 
> > Unit libc doesn't count since it is only for certain legacy reasons, and
> > Lazarus should NOT use it.
> 
> I know that, I know the reasons, and I agree.
> But those are posix functions, so they could be defined somewhere else
> than libc.

We don't specify posix compliance for a reason. That is because we want to
keep baseunix to be somewhat portable, and implementable on POSIX systems
that are not the newest Linux or FreeBSD.

These functions have been optional for a long time as the "real time
extensions", and while they are now standarized, e.g. the MONOTONIC
functionality is still optional (in the 2004 edition)

Besides these careful approach issues, there are also practical issues. 
Before a call is added to the supported set, there must be a good reason (1),
and it must first be somewhat proven to be implementable on all supported
*nixes, versions and flavours(2).  Some calls are hard to implement without linking to
libc, and baseunix must remain implementable without libc.

A workaround for such cases would be to keep it out of the RTL, and stuff it
in a 3rd party package. Or in case of a great need add it to packages/.


(1) this discussion is about a gettickcount implementation, but I'm not
entirely sure why this is needed so badly.
(2) embedded (like uclibc) issues shouldn't be underestimated.




More information about the Lazarus mailing list