Click to See Complete Forum and Search --> : Does C++ have a sleep() function?


aph3x
12-13-2000, 12:04 AM
title...

edit:...and if so, what header file do i need?

[This message has been edited by aph3x (edited 12 December 2000).]

Strike
12-13-2000, 12:43 AM
Well, yeah, the C sleep function. I think it's in unistd.h

man sleep

klamath
12-13-2000, 01:27 AM
man sleep

... would give you the manpage for sleep(1) - the utility. You're looking for man 3 sleep -- and yeah, it's in unistd.h

------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
Looking for an open source project to contribute to? Check out the Better Bulletin Board (http://bbb.sourceforge.net)

Strike
12-13-2000, 01:41 AM
Ha, dammit klamath http://www.linuxnewbie.org/ubb/smile.gif http://www.linuxnewbie.org/ubb/wink.gif

Thanks for checking/confirming that.

aph3x
12-13-2000, 04:00 AM
im aware of the sleep function available with unistd.h. unfortunately, im coding a program for my friend's business, and the code must be , *gasp*, windows compatible... sorry i forgot to mention that little detail http://www.linuxnewbie.org/ubb/biggrin.gif

im using borland to compile it, and ive done a little research and found that i need to include either dos.h or time.h, but neither seem to work. all i get is call to undefined function 'sleep' in main.
any ideas?

edit: also thought it would be worthwhile mentioning that when using dos.h, sleep() works when compiling c code, but not c++ code...

[This message has been edited by aph3x (edited 13 December 2000).]

BrianDrozd
12-13-2000, 09:26 AM
Originally posted by aph3x:
im aware of the sleep function available with unistd.h. unfortunately, im coding a program for my friend's business, and the code must be , *gasp*, windows compatible... sorry i forgot to mention that little detail http://www.linuxnewbie.org/ubb/biggrin.gif

im using borland to compile it, and ive done a little research and found that i need to include either dos.h or time.h, but neither seem to work. all i get is call to undefined function 'sleep' in main.
any ideas?

edit: also thought it would be worthwhile mentioning that when using dos.h, sleep() works when compiling c code, but not c++ code...

[This message has been edited by aph3x (edited 13 December 2000).]

Well, I'm not sure if this will help or not because I'm working with VC++ (I know, I know, it's pure evil, but what can I do?) Anyway, the Sleep() function is in winbase.h so you might want to check for that file.

aph3x
12-13-2000, 07:21 PM
nope, didnt work... thanks anyway http://www.linuxnewbie.org/ubb/biggrin.gif

any other ideas?