ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i have done the usleep but then it dont really work well
how do i test whether the correct timing was done?
like supposed
sending A was to be done in 10us and B 500us and C 50us
how do i check whether the correct timing was done
yes i know, but put sleep (0.001), and see - it WILL compile with no warnings even, and give (im assuming its a msec cos it is definitely less time than a sleep(1)) a delay of a msec.
The compiler doesn't give any error or even warnings when passing "0.01", not even with all warnings turned on (gcc -Wall -pedantic -ansi ...). But this is not only for sleep(). I've no idea why.
Probably sleep() has a minimal sleeping time, like nanosleep() has (10 or 1 ms depending on platform).
Anyways, it's not the right way to have a program sleep for a while. Use usleep(), or better yet, nanosleep() or select().
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.