Time.h

This is a discussion on Time.h within the C++ Programming forums, part of the General Programming Boards category; Could Someone Post the Contents of Time.h and How to use it? I want to be able to continue my ...

  1. #1
    GeekSeb
    Guest

    Time.h

    Could Someone Post the Contents of Time.h and How to use it? I want to be able to continue my programa fter a certain while if the user does not input something after a speciied time period.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    162
    Ok, to do something like that using time.h you can do something like this:
    PHP Code:
    long int starttime=(long int)clock();
    while(
    clock() - starttime TIMELIMIT//clock returns milliseconds 
    {} //Just have an empty while statement to pause the program.    
    //Do other stuff here 
    This doesn't check for user input, you will have to get someone else on that, but it will pause the program. You can always use the windows function Sleep(). Hope this helps you.
    Last edited by Crossbow; 02-11-2002 at 06:44 PM.

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    I know that I might get flamed for this but oh well.

    http://www.cplusplus.com/ref/ctime/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. time.h
    By zensatori in forum C Programming
    Replies: 28
    Last Post: 04-15-2007, 06:39 PM
  2. Help with time.h functions please.
    By Ifurita. in forum C++ Programming
    Replies: 4
    Last Post: 05-20-2003, 03:58 AM
  3. time.h and miliseconds question
    By Diamonds in forum C++ Programming
    Replies: 10
    Last Post: 12-16-2002, 07:41 AM
  4. Replies: 2
    Last Post: 10-18-2002, 08:30 AM
  5. a time.h problem
    By Max in forum C Programming
    Replies: 14
    Last Post: 10-15-2002, 02:43 PM

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