[Lazarus] How to program with time in milliseconds?

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Sun May 18 20:14:40 CEST 2014


On 2014-05-15 14:40, Michael Schnell wrote:
> clock_gettime seems to be Linux-only anyway.


No, that is incorrect. It is simply FPC's outdated FreeBSD support,
which I believe I have raised a bug report for.

On my FreeBSD 9.1 and 10 systems....

----8<-------------8<-------------8<-------------8<-------------8<----
[~]$ man clock_gettime
CLOCK_GETTIME(2)          FreeBSD System Calls Manual
CLOCK_GETTIME(2)

NAME
     clock_gettime, clock_settime, clock_getres — get/set/calibrate date and
     time

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <time.h>

     int
     clock_gettime(clockid_t clock_id, struct timespec *tp);

     int
     clock_settime(clockid_t clock_id, const struct timespec *tp);

     int
     clock_getres(clockid_t clock_id, struct timespec *tp);

DESCRIPTION
     The clock_gettime() and clock_settime() system calls allow the calling
     process to retrieve or set the value used by a clock which is specified
----8<-------------8<-------------8<-------------8<-------------8<----


Regards,
  - Graeme -

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




More information about the Lazarus mailing list