[linux-audio-dev] Linux and clocks

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] Linux and clocks
From: Martijn Sipkema (m.j.w.sipkema_AT_student.tudelft.nl)
Date: Thu Mar 21 2002 - 23:47:23 EET


I wrote a little program to test the accuracy of clock_nanosleep
under linux. Running SCHED_FIFO at the highest priority I did
 an absolute clock_nanosleep() followed by a clock_gettime() and
took the difference. I noticed that when using a short sleep time
the results were very good, but when using larger times the error
was several ms. What surprised me was that sometimes the
clock_nanosleep would be woken before the requested time, or
since this is not allowed, the time was adjusted after the sleep
function returned. This was using CLOCK_REALTIME. Is
CLOCK_REALTIME constantly adjusted? Linux doesn't seem
to have CLOCK_MONOTONIC right?

Is there something that can be easily done about the bad
performance of clock_nanosleep at long sleep times?

--Martijn


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Mar 21 2002 - 23:37:17 EET