[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:How to get a precise timestamp?



|I wrote a program where I have to use timestamps. To be more precise I use
|the call "ftime" instead of "time". However ftime increases the time in
|steps of 2 seconds. The milliseconds component of the structure filled in by
|ftime is always 0.
|
|An interval of 2 seconds is not precise enough. Is this a bug in the Gnu
|libs? Or a bug in the operating system? I am using Mint1.09 without any
|patches.
|
|Or is there another function I could call? I prefer functions that come from
|unix because those are quite well documented.

You should use the _5ms_gettimeofday from the portlib. This is a
function returning the UNIX time with a 5ms "granularity" (200Hz).
It's possible to get more precision but you will have to make your
own MFP timer functions.. not standard at all..

Stéphane


--
  Stephane Boisson   | 11, rue de la Garenne | Falcon030/MiNT, MacIIci, Un*x
boisson@worldnet.net |  92310 Sevres FRANCE  |   TCP/IP, XWindow, C, 680x0
http://www.worldnet.net/~boisson/
http://www.x4u.com/