Can I ask if anyone can advise me on the command to provide accurate timing delay in C which which I can use for my multithreading application using pthread?
I've tried generating a "for" loop which is not ideal in my case because the busy loop just takes up the processor and stops other processes from running in parallel. Also I've tried the "usleep" command but usleep(1) (presumably time delay of 1 microsec) is too slow. Can I ask what usleep is exactly doing - is it a kind of busy loop as well? If not, can I check if there is a command call "nanosleep"?
Please kindly advise if there is a nice way to generate this delay which does not require any processing (so that I can use it for the multithreading) and fast enough (preferably in nanosecs).
Thanks for your help in advance.