To call a function repeatedly after certain period

hi
I need to call a function repeatedly after some fixed time(100 milli seconds).
Which header files and classes should be used to do this.
sleep(milliseconds) and i think its in the standard library
Sleep does work, but it's not guaranteed to be 100% accurate :)
Neither sleep() nor any other user timing function can be 100% accurate for 2 reasons:
1) The system clock source may not provide enough granularity (unlikely in this case);
2) The process is at the mercy of the operating system to schedule it and run it when
the sleep interval expires.

#2 is why all POSIX timing functions make the weak guarantee that your process is guaranteed to sleep for at least the given amount of time, possible more or even infinite.

The best you can do short of writing kernel code is to set the process priority to the highest possible setting to minimize scheduling latency (#2).
Topic archived. No new replies allowed.