-
April 25th, 2010, 06:10 AM
#1
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.
-
April 25th, 2010, 06:31 AM
#2
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
-
April 25th, 2010, 06:41 AM
#3
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.
-
April 25th, 2010, 06:45 AM
#4
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
-
April 25th, 2010, 06:57 AM
#5
Re: counting down the time and...
Originally Posted by leKoxn
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.
-
April 25th, 2010, 02:25 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|