sleeping a C++ program?

Need help with C, C++, perl, python, etc?

sleeping a C++ program?

Postby utrrrongeeb » 2006-09-18 10:01

I don't know C or C++ very well (I plan to learn more when I have time), and I want to know how to sleep the program for a set number of milliseconds. I would prefer if the library needed was as small as possible.
Any responses are appreciated.
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0
User avatar
utrrrongeeb
 
Posts: 255
Joined: 2006-05-14 09:48
Location: Eastern Canada

Postby lacek » 2006-09-18 10:40

Use 'usleep' function. It's obsolete, and superseded by 'nanosleep', but it's more convenient... :-)
See the man pages for more details.
lacek
Moderator Team Member
 
Posts: 769
Joined: 2004-03-11 18:49
Location: Budapest, Hungary

Postby utrrrongeeb » 2006-09-20 09:49

Um.. Could you tell me what argument to pass the man or info command to look up a language command?
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0
User avatar
utrrrongeeb
 
Posts: 255
Joined: 2006-05-14 09:48
Location: Eastern Canada

Postby tinker » 2006-09-20 14:10

lecaro wrote:Um.. Could you tell me what argument to pass the man or info command to look up a language command?


man usleep

info usleep


Both work for me on my system, what is the error message you receive?
tinker
 
Posts: 189
Joined: 2006-09-09 18:13

Postby utrrrongeeb » 2006-09-21 09:26

Both work for me on my system, what is the error message you receive?

Nothing, just I wasn't sure whether you could look up a language function with man just as you could look up a command.
One other thing about C -- when I have a for loop in the main function, it refuses to compile. Why is that?
utrrrongeeb formerly lecaro
Art #429775 on 'Etch' 4.0r0
User avatar
utrrrongeeb
 
Posts: 255
Joined: 2006-05-14 09:48
Location: Eastern Canada

Postby ajdlinux » 2006-09-21 10:32

Please provide an error message.
Jabber: xmpp:ajdlinux@jabber.org.au
Spammers, email this: ajdspambucket@exemail.com.au
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia


Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable