Re: Get GamePlaying Time

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...
Lone_EverGreen_Ranger said...

I am currently working on a RPG Game. I am trying to figure out how I would get the game playing time. As in seconds, minutes and hours. I have an idea, however I am puzzled as to how to go about it. Any examples would be appericated, if needed I can show my code. Below is my code. I have the variables, but I'm not sure how would I go about using them to get the game playing time. As I said any examples would be great.

The easiest thing is probably to note the start and stop times using now(), and then use diff(), which returns the number of seconds between the two. You can keep adding seconds for subsequent sessions, and then convert that sum as needed for display purposes.

Matt

Could I get a working example of that? It would be easier for me to figure out if I had a visual example.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu