    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: Don't Touch That Clock!</title>
        <link>https://members.accu.org/index.php/journals/1181</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>


        <h2>Journal Articles</h2>


<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 14, #4 - Aug 2002</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c113/">144</a>
                    (17)
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;Don't Touch That Clock!</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 03 August 2002 13:15:53 +01:00 or Sat, 03 August 2002 13:15:53 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id="d0e22"></a></h2>
</div>
<p>A friend wanted to transfer a large amount of data from her
account in America, so I scheduled a download to take place
overnight, using '<tt class="function">wget</tt>', a good mirroring
tool. In the morning, I found this:</p>
<pre class="screen">
calc_rate: Assertion `msecs &gt;= 0' failed.
</pre>
<p>Apparently, it was trying to calculate the transfer rate, and
found it to be negative. This happened at 2:30am, which is the time
when my system synchronises its clock to the university's NTP time
server. I checked the logs and it seems the NTP synchronisation
took the system clock back 6 seconds, and this must have caused the
negative time difference.</p>
<p>I looked through the wget source and found it calls the Unix
function '<tt class="function">gettimeofday</tt>' to calculate the
time to the desired accuracy. Clearly it would be better to use a
timer that is relative and not affected by clock changes, but there
doesn't appear to be such a thing in the GNU C library.</p>
<p>Apparently, any programmer who deals with elapsed times on a
multi-tasking system has to be aware of the fact that somebody
might change the system clock while the program is running. This
doesn't strike me as an ideal situation.</p>
<p>Of course, it is possible to work around the problem by ignoring
unusual timings, or disabling the progress indicator altogether
(since it's not really needed in a batch job), or disabling the NTP
program that night, or telling it to &quot;slew&quot; the clock instead of
setting it (this means that the clock's speed is slightly changed
for a while until it has gained or lost the required amount of
time, so that the clock never &quot;jumps&quot;, but it can take a long time
to perform). Still, it seems odd that a system such as Unix should
not differentiate between absolute clock times, which might be
resynchronised, and relative timers which should not be affected.
Most PDAs manage fine no matter how often you set the clock.</p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
