   Need help making clock
  I am trying to add a clock into my game, but don''t have an idea where I should start. I want the clock to count down to zero (this will signify end of game). I tried searching online but everything I am finding relates to timing animation. I am using MSVC++ and DirectX. Any suggestions?  
    Well, two timers I have used...  SetTimer(...) to trigger a timer up to 1 millisecond, have to add a WM_TIMER message handler.  The two functions I would use are :  QueryPerformanceFrequency(...)  QueryPerformanceCounter(...)  Much better resolution with those function calls as it uses an onboard hi-res timer (i believe).  Checkup those functions under MSDN for more description. ;GetTickCount()TimeGetTime() ;  I might of done too much cross-platform development but even when working on a single platform I still have a single AI entry point (ThingManager or WorldManager) that gets called to process the game world.One of the input parameters passed to this controller is the current tick counter from which I can calculate the elapsed time.A timer class can be ticked with the updated elapsed time and asked if it is still running or not. This timer class can either count up or count down depending on requirements.The advantages of doing things this way are (no specific order);1) Cross platform safe.2) I can control time! If I want to slow down or speed the game up I can either say exactly the amount of elapsed time per frame or apply a scaler to the value.3) It does only what it needs to do. No processing or memory overhead (like you get with a windows timer)4) I have complete control for debugging and handling purposes. [edited by - MIchaelCarr on July 31, 2003 12:26:00 PM]