[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
> -----Original Message-----
> From: email@example.com
> [mailto:firstname.lastname@example.org] On Behalf Of P.Y.Ang@xxxxxxx.uk
> Sent: Wednesday, July 21, 2004 18:22
> To: dev-etrax
> Subject: sys/timeb.h
> Hi all,
> I am trying to do some synchronisation here, the timing is up
> to a precision level of millisecond. Normally the functions in
> "sys/timeb.h" would do the job. However, in etrax100 elinux
> environment, this header file is missing.
> Can anyone please tell me what's the other option to detect
> the timing to that precision level?
> Many thanks in advance.
Here is an excerpt from the manual page of ftime() (which is the
function declared in sys/timeb.h):
This function is obsolete. Don't use it. If the time in
seconds suffices, time(2) can be used; gettimeofday(2)
gives microseconds; clock_gettime(3) gives nanoseconds but
is not yet widely available.
My recommendation would be to use gettimeofday().