9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Powell <richard@powell.name>
To: 9fans <9fans@cse.psu.edu>
Subject: Re: [9fans] timesync is slow to set the time after boot
Date: Sun, 16 Mar 2003 00:15:47 -0800	[thread overview]
Message-ID: <3E7432B3.2050805@powell.name> (raw)
In-Reply-To: <0c96ecd2b95642b0199eacca2aaea7ba@plan9.bell-labs.com>

David,

If there are problems reading the clock on the first pass, maybe we 
could just wait one second between passes instead of one minute. (Or 
even zero seconds if you think that's safe enough.).

Thanks for looking into this.
Richard



diff -c timesync.org timesync.c.tsecs0
*** timesync.c.org        Fri Mar 14 19:42:32 2003
--- timesync.c.tsecs1   Sun Mar 16 00:05:10 2003
***************
*** 344,349 ****
--- 344,350 ----
                         break;
                 case Rtc:
                         s->stime = sample(rtctime);
+                       tsecs = 1;
                         break;
                 case Utc:
                         s->stime = utcsample();
***************
*** 385,391 ****
                 diff = s->stime - s->ltime;
                 if(diff > 10*SEC || diff < -10*SEC){
                         // we're way off, just set the time
!                       secs = MinSampleSecs;
                         settime(s->stime, 0, 0, 0);
                 } else {
                         // keep a running average of the error.
--- 386,392 ----
                 diff = s->stime - s->ltime;
                 if(diff > 10*SEC || diff < -10*SEC){
                         // we're way off, just set the time
!                       tsecs = secs = MinSampleSecs;
                         settime(s->stime, 0, 0, 0);
                 } else {
                         // keep a running average of the error.



David Presotto wrote:
> I stopped ignoring the first sample.  It made some difference since the
> first sample is usually perverted a bit by the system starting up.  However,
> it really doesn't help to have a wrong time for a minute.   Thanks powell.
> 



  reply	other threads:[~2003-03-16  8:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-15  6:48 Richard Powell
2003-03-15 12:49 ` David Presotto
2003-03-15 18:00 ` David Presotto
2003-03-16  8:15   ` Richard Powell [this message]
2003-03-16 13:28     ` David Presotto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E7432B3.2050805@powell.name \
    --to=richard@powell.name \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).