Highres delay help

From: Carl W (calle79_at_inorbit.com)
Date: 05/27/05


Date: 27 May 2005 05:21:44 -0700

Dear all.

I need a way to implement a high resolution delay with at least a
resolution of 1 ms. Preferabely less. nanosleep cant help me, as the
tickrate is 100 Hz, which gives me a granularity of 10 ms, which is
way too rough for me.

I have seen a lot of hints on the web using some kind of highres timer
timer_create(CLOCK_HIGHRES...)

On my workstation (running solaris 8) i get a granularity of 3 ns
which is more than enough.

What I really want to do is to write a loop, which loops at a
predefined frequency.

loop
{
/*Do someting*/
delay(~1 ms)
}

I dont have very extensive C programming experience and this i why I
wonder how the highres timer works and how I could use it to implement
my program.
I'd be glad if someone could give me real code examples which shows me
in a straightforward way.

I hope there is anyone ont there who can help me. Time is a crucial
matter right now.

Best wishes,

Carl