Re: Avoiding microtime(9) global state
"Erik E. Fair" <[email protected]> Wed, 30 Jun 2004 13:19:44 -0700
| Newsgroups | gmane.os.netbsd.devel.smp |
|---|---|
| Message-ID | <p06020409bd08cf540197@[192.5.16.121]> |
It's very important to separate Time of Day from interval timing. Time of Day you adjust to be correct with NTP, or just with date(1), so that when you want to record the time that an event occurred, you take this value. Interval timing is to measure between a start point and a stop point. You never want this going backwards. Principally, you want the frequency of the counter to be accurate, so you might adjust how fast it's ticking, once you figure out (with NTP or some other method) how bad your system's clock crystal is. NetBSD should provide both facilities (ToD & interval time), and the code we write needs to be clear about which it is using and why. Erik <[email protected]>