[reSIProcate] Timers: why system time?

Alexander alt at kaluga.ru
Thu Oct 30 06:17:32 CDT 2008


Hi

Here is a patch to use monotonic clock.
It is 3 modified files from reSIProcate 1.4.
Attached files have Windows (CLRF) eof-style.

Windows
=======

GetTickCount() with 16 ms inaccuracy used.
It is very simple to change it to timeGetTime() etc with 1 ms accuracy,
but it will require init/fini calls on application level and linking
with Winmm.lib 

Tested on Windows XP SP2, compiled with VS7.1

Not tested on Windows CE

Linux
=====

If monotonic clock is not available (compile time and runtime) it will
fall back to gettimeofday() 

I am not familiar with reSIProcate build system so I use workaround to
avoid linking with librt:
syscall( __NR_clock_gettime, ... )
instead of clock_gettime(...)

IMHO it may not work on other POSIX compliant platforms.

Pass only some basic tests on my Linux PC (2.6.18 kernel)

Any feedbacks appreciated.

Regards
Alexander Altshuler
Xeepe team
http://xeepe.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: monotonic_patch.zip
Type: application/octet-stream
Size: 10931 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20081030/8ef6de38/attachment.obj>


More information about the resiprocate-devel mailing list