How to add some time to a prog

This is a discussion on How to add some time to a prog within the C++ Programming forums, part of the General Programming Boards category; Is there any command that makes the program stop for a few seconds and then move on again?...

  1. #1
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408

    How to add some time to a prog

    Is there any command that makes the program stop for a few seconds and then move on again?

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Very dependant on operating system and compiler.
    For msvc and windows....

    #include <windows.h>

    Sleep(1000); // will pause for a minimum of 1 second. number is millisecs. notice the S not s
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408

    NOOOOO

    I dont have windows.h
    Header files are copyrighted right?
    If thats not the case can somebody please email me windows.h
    My email is: erionderiond@hotmail.com

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    >>> If thats not the case can somebody please email me windows.h

    Pointless...

    http://www.cprogramming.com/boardfaq.html#header

    ... your own OS will have a similar function, (might be sleep(), wait() etc.).
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    id u use borlans then include <dos.h> and use

    delay(time);
    where time is = integer in miliseconds

  6. #6
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    sleep() is also in dos.h

    this is for borland ver3

    sleep(1); //sleeps for 1 sec
    Last edited by ihsir; 02-25-2002 at 05:03 AM.
    -

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vector vs. array.
    By matsp in forum C++ Programming
    Replies: 37
    Last Post: 06-23-2008, 01:41 PM
  2. Journey time prog 1 minute wrong
    By mike_g in forum C Programming
    Replies: 4
    Last Post: 10-12-2006, 04:41 AM
  3. need help making a dot bounce up and down y axis in this prog
    By redwing26 in forum Game Programming
    Replies: 10
    Last Post: 08-05-2006, 01:48 PM
  4. Time conversions
    By mariabair in forum C++ Programming
    Replies: 2
    Last Post: 01-02-2004, 04:55 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21