C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Time

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Michael
Guest





PostPosted: Sun Aug 29, 2004 2:40 pm    Post subject: Time Reply with quote



im new to this c++ programming
im making a game and need to workout how to do certain things like run
functions at a certain time after the program has run
eg after 10 seconds run the pen function

can anyone help please??

thanx michael


Back to top
osmium
Guest





PostPosted: Sun Aug 29, 2004 2:44 pm    Post subject: Re: Time Reply with quote




Michael <michaelhims (AT) blueyonder (DOT) co.uk> wrote

Quote:
im new to this c++ programming
im making a game and need to workout how to do certain things like run
functions at a certain time after the program has run
eg after 10 seconds run the pen function

can anyone help please??

thanx michael





Back to top
osmium
Guest





PostPosted: Sun Aug 29, 2004 2:48 pm    Post subject: Re: Time Reply with quote



Michael writes:

Quote:
im new to this c++ programming
im making a game and need to workout how to do certain things like run
functions at a certain time after the program has run
eg after 10 seconds run the pen function

Sorry for the blank post.

C++ comes with functions cclock() and ctime() which may be helpful. But
your particular compiler may have something better which probably has
"sleep" somehow suggested by the name. So if you don't like cclock or ctime
and you can't find anything better with that hint, post to a newsgroup for
your particular compiler.



Back to top
Gianni Mariani
Guest





PostPosted: Sun Aug 29, 2004 3:33 pm    Post subject: Re: Time {OT response] Reply with quote

Michael wrote:
Quote:
im new to this c++ programming
im making a game and need to workout how to do certain things like run
functions at a certain time after the program has run
eg after 10 seconds run the pen function

can anyone help please??

Apart from the standard facilities provided by the compiler (as
mentioned in the previous post), you may find other facilities provided
by the OS might be more interesting.

Unix has an "alarm" method that will cause a signal to be sent as well
as various other timer facilities.

If you don't need asynchronous timing, you mat be able to use the
"select" or "poll" system calls that allow you to both wait on input and
a timeout.

All of these facilities require quite a significant understanding of how
they interact with the C++ library - not somthing a beginner will find
trivial.

Back to top
Michael
Guest





PostPosted: Sun Aug 29, 2004 5:27 pm    Post subject: Re: Time Reply with quote

its dev-cpp the beta version

but thanx ill give it a try

"osmium" <r124c4u102 (AT) comcast (DOT) net> wrote

Quote:
Michael writes:

im new to this c++ programming
im making a game and need to workout how to do certain things like run
functions at a certain time after the program has run
eg after 10 seconds run the pen function

Sorry for the blank post.

C++ comes with functions cclock() and ctime() which may be helpful. But
your particular compiler may have something better which probably has
"sleep" somehow suggested by the name. So if you don't like cclock or
ctime
and you can't find anything better with that hint, post to a newsgroup for
your particular compiler.





Back to top
Mike Wahler
Guest





PostPosted: Sun Aug 29, 2004 10:19 pm    Post subject: Re: Time Reply with quote


"osmium" <r124c4u102 (AT) comcast (DOT) net> wrote

Quote:
Michael writes:

im new to this c++ programming
im making a game and need to workout how to do certain things like run
functions at a certain time after the program has run
eg after 10 seconds run the pen function

Sorry for the blank post.

C++ comes with functions cclock() and ctime()

That's clock() and time(). Declared by header <ctime>
(or <time.h>).

-Mike



Back to top
Michael
Guest





PostPosted: Sun Aug 29, 2004 10:37 pm    Post subject: Re: Time Reply with quote

wut do i write in the brackets??

"Mike Wahler" <mkwahler (AT) mkwahler (DOT) net> wrote

Quote:

"osmium" <r124c4u102 (AT) comcast (DOT) net> wrote in message
news:2pe8p4Fk66bmU1 (AT) uni-berlin (DOT) de...
Michael writes:

im new to this c++ programming
im making a game and need to workout how to do certain things like run
functions at a certain time after the program has run
eg after 10 seconds run the pen function

Sorry for the blank post.

C++ comes with functions cclock() and ctime()

That's clock() and time(). Declared by header <ctime
(or
-Mike





Back to top
Mike Wahler
Guest





PostPosted: Mon Aug 30, 2004 3:35 am    Post subject: Re: Time Reply with quote


"Michael" <michaelhims (AT) blueyonder (DOT) co.uk> wrote

Quote:
wut do i write in the brackets??

[Please don't top post.] What do you mean by
your question? Do you mean "how do I use those
functions?" If so, you need a standard library
reference so you can look them up. This could
be from a textbook or from your compiler documentation.
For C++ books, see www.accu.org for reviews and
recommendations.

-Mike



Back to top
Karthik Kumar
Guest





PostPosted: Wed Sep 01, 2004 8:57 am    Post subject: Re: Time Reply with quote

Michael wrote:

Quote:
wut do i write in the brackets??

"Mike Wahler" <mkwahler (AT) mkwahler (DOT) net> wrote in message
news:CDsYc.2085$8d1.535 (AT) newsread2 (DOT) news.pas.earthlink.net...

"osmium" <r124c4u102 (AT) comcast (DOT) net> wrote in message
news:2pe8p4Fk66bmU1 (AT) uni-berlin (DOT) de...

Michael writes:


im new to this c++ programming
im making a game and need to workout how to do certain things like run
functions at a certain time after the program has run
eg after 10 seconds run the pen function

Sorry for the blank post.

C++ comes with functions cclock() and ctime()

That's clock() and time(). Declared by header <ctime
(or
-Mike


There are two levels of granularities here - in terms of seconds and
clocks.

CLK_TCK macro would get the number of clock ticks per second.

So depending on your profiling necessity, you can choose from one of
the two.

Aliter:
This link might be helpful ..

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


--
Karthik.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.