<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:12pt">Sounds reasonable to me.<br><br>Alternatively, if one millisecond resolution isn't required, what about changing msclock() so that it returns an unsigned int containing the number of elapsed TENTHs of a second?<br><br>Then we would have roughly 52 * 100 days before rollover.  That's over 14 years :-)<br><br>Thanks,<br>FiSH  K6FSH<br><div><br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><br><div style="font-family: lucida console,sans-serif; font-size: 10pt;"><font size="2" face="Tahoma"><hr size="1"></font><font size="2" face="Tahoma"><b><span style="font-weight: bold;">From:</span></b> </font><font size="2" face="Tahoma">Maiko Langelaar <maiko@pcs.mb.ca><br><b><span style="font-weight: bold;">To:</span></b> TAPR xNOS Mailing List
 <nos-bbs@tapr.org><br><b><span style="font-weight: bold;">Sent:</span></b> Wed, August 4, 2010 9:51:11 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [nos-bbs] Update - Timer issues in JNOS<br></font><br><br>I'm just posting this in case anyone is interested or sees<br>a flaw with the approach I'm using.<br><br>After thinking about this a bit more, I've concluded that perhaps<br>there is a much better, much easier way to do this, and one which<br>involves minimal code changes.<br><br>Changing to unsigned only fixes the problem for another 25 days, after<br>a period of 52 days or so, the negative timer problem will resurface,<br>since going from signed to unsigned only doubles the maximum value.<br><br>Moving to a long will fix this on x86_64 systems, but not on  i386 systems,<br>since long and int are same size on those systems. I could really minimize<br>the code changes by instead keeping the original code, and just
 resetting the<br>NOS start time every 20 days, and create a '20 day counter' that will get<br>bumped up every 20 days. Minimal code changes, and it will work as long as the 20 day counter never overflows (which it won't). The counter in<br>conjunction with the start time can easily tell us the 'uptime'.<br><br>I've already checked and if I start changing stuff from signed to unsigned<br>or whatever, there is more code changes than I really care to make.<br><br>Any comments ?<br><br>Maiko<br><br><br>_______________________________________________<br>nos-bbs mailing list<br><a ymailto="mailto:nos-bbs@tapr.org" href="mailto:nos-bbs@tapr.org">nos-bbs@tapr.org</a><br><a href="https://www.tapr.org/cgi-bin/mailman/listinfo/nos-bbs" target="_blank">https://www.tapr.org/cgi-bin/mailman/listinfo/nos-bbs</a><br></div></div>
</div><br>

      </body></html>