I am trying to create a clock for my game. However, I am having difficulty making the clock consistent. Depending on where I am in the game, the time will change faster or slower. Right now all I do is have variables for minutes, seconds, etc, and on every loop through main, i update the variables. I use wait() to slow down the clock from running too fast. However, I think it's those same wait() statements (in other functions) that are making the clock inconsistent.

Is there any way I can use the system time to make my own clock? Are there any examples of this?

My clock needs to start at 7:00 AM and go to 7:00 PM at which the game ends. But the game shouldn't last more than 20 minutes.

Any ideas?

Doriel