time based loop

Hi,

Looking for time based loop in c or c++. Im trying to
implement a frame/sec rendering architecture in my application.

All i need is a reliable time base loop.

Thanks,
ctremblaAsked:
Who is Participating?
 
NetminderConnect With a Mentor Commented:
Per recommendation, points NOT refunded and question closed.

Netminder
EE Admin
0
 
NeutronCommented:
Which OS?

Greetings,
    Ntr:)
0
 
ctremblaAuthor Commented:
Hi Neutron,

multiplatform.  I already have a function to retreive the
time that is multiplatform.
0
 
CJ_SCommented:
There are several ways you can do that. Use the getTime function to retrieve the time, and keep that in mind. Then use it again for the next frame. Calculate the difference in seconds. Then do 1 / difInSeconds and you have the fps...of course reset the first time variable to the newer value.

Regards,
CJ
0
 
nico5038Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.