# C++ timing issues.



## GSG-9 (Aug 10, 2008)

Hello everyone, I have a program that has been sitting around for a few months and I have some issues I cant seem to fix on my own. The program is a platformer using GLUT/Open|GL. My problem is I cannot get my program to run a certain number of times (20 times a second is what i would like) and then wait. Right now it goes as fast as your computer will let it, causing the game to end before you can tell whats going on (At least on my desktop, on my laptop its playable.)

I tried using Sleep() but cannot seem to get the right .h files in place.
I also do NOT want to use pause.

If anyone can help I would greatly appreciate it.

The project is below...


EDIT ParticleMan.ccp is the main file and the one that needs a system.


----------



## Oliver_FF (Aug 10, 2008)

This should help:
http://www.gamedev.net/community/forums/topic.asp?topic_id=475529

Oh, I think the Sleep() function is defined in dos.h ... maybe...


----------



## Deleted member 3 (Aug 10, 2008)

system.threading.thread.sleep() in .NET, so look at threading things?


----------



## GSG-9 (Aug 11, 2008)

Oliver_FF said:


> This should help:
> http://www.gamedev.net/community/forums/topic.asp?topic_id=475529
> 
> Oh, I think the Sleep() function is defined in dos.h ... maybe...



That might help, im going to try it when I get home, but will that actually cause it to process the game at a slower speed? I will see 



DanTheBanjoman said:


> system.threading.thread.sleep() in .NET, so look at threading things?



I dont have a .NET compiler and am not sure how to utilize that function.


----------

