-
I'm not on a network and I have auto-sync turned off.
"difference between current time and desired time"
Based on what? As in, what do I reference to do the math if the time is the time and yet the time is the problem?
Thanks for helping but I think this will go down as hack time, meaning time to do some ugly code with stupid comments.
Anyway, thanks again.
-
Code:
while (current_time < desired_time)
{
sleep(desired_time - current_time);
}
Desired_time could be, for example, 7:04:00. In your case, on the minute time goes backwards, it will first sleep 60 seconds, check, realize now there's 3 seconds left, and sleep 3 more seconds, before returning.
-
It happens that I was already doing that here:
http://cboard.cprogramming.com/cplus...ml#post1075646
And surprisingly, it does work to give me 00 every time (although I'm still suspicious it's too KISS).
After more Googling, I'm not the only one:
NTP 4.2.6p4 Released - comp.protocols.time.ntp | Google Groups
It's good as it's going to get without buying a new computer (evidentally).
-
Hmm if your system is really losing 2 seconds every 10 minutes, that would be 12 seconds per hour, or about 5 minutes a day. I'm sure that would be noticeable?
-
I found something interesting => GetSystemTimeAdjustment:
GetSystemTimeAdjustment function
My computer is TRUE.
It says (quote):
A value of TRUE indicates that periodic time adjustment is disabled, and the system time-of-day clock advances at the normal rate. In this mode, the system may adjust the time of day using its own internal time synchronization mechanisms. These internal time synchronization mechanisms may cause the time-of-day clock to change during the normal course of the system operation, which can include noticeable jumps in time as deemed necessary by the system.
Bingo.