Thread: Delay by second...

  1. #16
    Registered User
    Join Date
    Jun 2002
    Posts
    79
    Two functions of dos.h, delay and sleep suspend the execution of the program for a specified time interval.

    void delay(unsigned milliseconds);
    void sleep(unsigned seconds);

    Compiler : Turbo C++ v3.01

  2. #17
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Location
    Europe
    Posts
    448
    Originally posted by Shadow
    Leave the sleep function alone.

    When you call sleep, do it like so.

    printf("Hello\n");
    sleep(3);

    That's all

    Please don't grave dig.

    Moerators?
    Actually, the Sleep() function works in milliseconds and the S has to be uppercase.
    cout<<"Hi all!";
    Sleep(3000);
    That would stop it for 3 secs.
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

  3. #18
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Originally posted by -=SoKrA=-
    Actually, the Sleep() function works in milliseconds and the S has to be uppercase.
    cout<<"Hi all!";
    Sleep(3000);
    That would stop it for 3 secs.
    Actually that was his own sleep function he wrote
    Not the one in windows.h

    Read the start of this thread to see.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Regarding delay in the connection
    By byatin in forum Networking/Device Communication
    Replies: 2
    Last Post: 08-19-2008, 02:59 PM
  2. temperature sensors
    By danko in forum C Programming
    Replies: 22
    Last Post: 07-10-2007, 07:26 PM
  3. Networking (queuing delay, avg packet loss)
    By spoon_ in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 09-05-2005, 11:23 AM
  4. 2-3 Second delay with alarm()
    By Longie in forum C Programming
    Replies: 11
    Last Post: 06-20-2004, 08:46 PM
  5. Delay
    By CanadianOutlaw in forum C++ Programming
    Replies: 4
    Last Post: 09-13-2001, 06:28 AM