How to pause

This is a discussion on How to pause within the C Programming forums, part of the General Programming Boards category; How can I pause a program for a specific number number of seconds? I'm using MS Visual C 6.0. Thanks....

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    98

    How to pause

    How can I pause a program for a specific number number of seconds? I'm using MS Visual C 6.0.
    Thanks.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,834
    Sleep() as defined in windows.h
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Include "windows.h" and use "Sleep()" - the Sleep function takes number of milliseconds, so you need to say "Sleep(1000)" to sleep for one second.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    98
    At first it wouldn't work, but then I realized I was typing sleep instead of Sleep.
    Thanks for the help!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fork(), pause(), and storing PID's in a linked list
    By vital101 in forum C Programming
    Replies: 10
    Last Post: 09-28-2007, 03:16 AM
  2. Why doesn't this cin.get() pause the program?
    By Loctan in forum C++ Programming
    Replies: 5
    Last Post: 06-24-2006, 05:06 PM
  3. pause
    By Moffesto in forum C++ Programming
    Replies: 4
    Last Post: 06-21-2002, 11:15 AM
  4. Problem with the pause function
    By indigo0086 in forum C++ Programming
    Replies: 1
    Last Post: 11-03-2001, 12:38 PM
  5. Pause function ???
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 09-02-2001, 09:22 PM

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