hi all

i am using VC++ editor. Can anyone tell me how to insert sleep in my program? i have tried sleep(). but it is giving an warning

'sleep' undefined; assuming extern returning int.
Thanks in advance

Recommended Answers

All 9 Replies

It's Sleep(), note the capital 'S', and it's in windows.h. It counts in milliseconds.

Thanks Salem
how to increase it to seconds from milliseconds?

How about Sleep(1000); since 1000 ms=1 sec

How about Sleep(1000); since 1000 ms=1 sec

i have tried with that but its is hardly giving me the desired effect

And what is "the desired" effect?

apparently he desires a function to convert seconds to milliseconds

now where is that function?

i know i left it around here somewhere....

apparently he desires a function to convert seconds to milliseconds

now where is that function?

i know i left it around here somewhere....

i want to give the sleep in seconds..

i want to give the sleep in seconds..

It doesn't matter. There's 1000 milliseconds in a second. If you want 5 seconds then you'd pass 5000 for example.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.