[ntp:questions] Re: Why not use timeEndPeriod?

Danny Mayer mayer at ntp.isc.org
Thu Aug 31 11:59:19 UTC 2006

Martin Burnicki wrote:
> YOYO wrote:
>> Hi,
>> i found a strange question. when i use my ntpdate to
>> synchronize time in my network(*), the cpu usage rises
>> to a high level, and when i stop ntpdate, cpu reaches a
>> proper value.
>> so, i found the following code in ntpdate.c, the point is
>> when we called "timeBeginPeriod" to adjust the timer,
>> we should call the pare function "timeEndPeriod".
>> without doing this, the cpu usage for each process
>> might  rise a little bit, and the total cpu usage might
>> rises a higher level(normally 30% higher).
>> is that something wrong with the function call?
>> thanks for any hints or thoughts.
> You're right, timeEndPeriod should be called when an application shuts down
> which has called timeBeginPeriod at startup.
> For ntpd I've submitted a patch which calls these functions properly to set
> the Windows multimedia timer optionally to highest resolution while ntpd is
> active. This is in order to avoid time steps which are introduced if
> another application which uses the MM timer is started or stopped.
> However, in case of ntpdate using the MM timer does not make sense anyway,
> IMHO, so we should remove the timeBeginPeriod call, or add the missing
> timeEndPeriod call. Some cleanup is required, anyway. If you agree I'll
> open a bugzilla issue on this.
> Martin

Agreed. But why are you using ntpdate at all? ntpd does everything you
need and more and runs as a service on Windows. Once you set it up you
are done, unless you need to change the list of servers in which case
you change the list and restart the service.


More information about the questions mailing list