CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2010
    Posts
    23

    Post counting down the time and...

    i want to know how to counting down the time ?
    and how to get current time?
    and also if there is a statement ,how can i print out each character of this statement in a second in console app?

    any help would be appreciated.

  2. #2
    Join Date
    Aug 2009
    Posts
    23

    Re: counting down the time and...

    To get current time: GetSystemTime

    To count time: get two structures at two different times with the api above and difference-them

  3. #3
    Join Date
    Apr 2010
    Posts
    23

    Re: counting down the time and...

    thanks for answer.

    and which header should i include because in <ctime> it doesn't exist(or how to use them)?

    it seem's it's not clear about what i said

    """"and also if there is a statement ,how can i print out each character of this statement in a second in console app?""""



    i want to know how can i use "sleep" in c++?
    Last edited by dariush; April 25th, 2010 at 06:45 AM.

  4. #4
    Join Date
    Aug 2009
    Posts
    23

    Re: counting down the time and...

    Really can't understand your question.. do you want to print out the time difference quickly ('in a second') or in seconds difference format (like 4943 seconds between the two events) ?

    And I don't also get what does it have to do with "sleep" function

  5. #5
    Join Date
    Apr 2010
    Posts
    23

    Re: counting down the time and...

    Quote Originally Posted by leKoxn View Post
    Really can't understand your question.. do you want to print out the time difference quickly ('in a second') or in seconds difference format (like 4943 seconds between the two events) ?

    And I don't also get what does it have to do with "sleep" function
    i agree that is a dumb question

    for example if the statment is "hello"
    when program execute it print "h"(after 1 second print)"e"(and again after one second print )"l"
    and so on ... till the statement finished and to my knowledge it can happen with sleep function but i don't know how i can use "sleep" function

    and also the GetSystemTime didnot worked(i.e if there is a header file should i include it?)
    i don't get "with the ""api"" above and difference-them ".

    thanks for help.
    Last edited by dariush; April 25th, 2010 at 07:02 AM.

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: counting down the time and...

    and which header should i include
    Go to Google, put 'GetSystemTime function' to request, do the search, follow the link to MSDN, go to the article's bottom and see what header and lib file to include.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured