Sync Time With System Clock

So basically i am trying to sync my time class i made so that it adds 1 to the seconds as the system clock adds seconds. I am kind of lost on this concept at the moment.

Any help would be nice
You'll probably want to execute it in its own thread. Almost 100% of the time, the thread should be waiting for a system wait function to return. A wait function can make a thread wait a given amount of time without consuming CPU.
i definitely agree with running it in it's own thread. how to implement it depends a little thought on what exactly you are using it for. if you are trying to display the actual system time, you'll be calling the API function that returns the local system time... if on the other hand, you are just counting seconds, you'd want to use a timer object that will alert you every second. information for both can be found in MSDN.
*sigh*

Why do you want to do this? That only works if the CPU is very lightly loaded. As soon as you start putting any load at all on the CPU you will start to lose ticks.

Topic archived. No new replies allowed.