Hi Fons,
thanks for this tip, The functions look good and helpful. But perhaps
I'm not getting something. I made a very simple test program, no RT
thread, no special thread at all.

https://www.dropbox.com/s/ox9owa6fdd459dt/nanosleep.cpp

I tried including both time.h and ctime. The result is that the program
just returns and the wakeup time and now drift apart ever more. Does it
need a specific thread environment?

Best wishes,

Jeanette

Feb 23 2023, Fons Adriaensen has written:
...
And using

   clock_nanosleep (CLOCK_MONOTONIC, TIMER_ABSTIME, &T, 0);

in a RT thread I get

Min ~   5 us
Max ~ 105 us
Average ~ 23 us

No need for any special libraries...


Ciao,

--
FA

_______________________________________________
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org


--
 * Website: http://juliencoder.de - for summer is a state of sound
 * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
 * Audiobombs: https://www.audiobombs.com/users/jeanette_c
 * GitHub: https://github.com/jeanette-c

Do you even know what I like
Just what I'm living for,
What I adore <3
(Britney Spears)
_______________________________________________
Linux-audio-dev mailing list -- linux-audio-dev@lists.linuxaudio.org
To unsubscribe send an email to linux-audio-dev-le...@lists.linuxaudio.org

Reply via email to