Re: Avoiding microtime(9) global state
Martin Husemann <[email protected]> Thu, 1 Jul 2004 16:04:48 +0200
| Newsgroups | gmane.os.netbsd.devel.smp |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jun 30, 2004 at 06:09:05PM -0700, Jason Thorpe wrote: > What is the point of having microtime() or any microtime()-like call if > the call's value is meaningless? That's what you're proposing. No, what I'm proposing is a GetTickCount()^Wnanotime() function that is very similar to the current cc_microtime implementation, but that - has nanosecond granularity - does not promise strong montonicity - is not affected by adjtime It's value would roughly be "time since boot"; the implementation could probably avoid any locking. I suppose most callers of microtime() could be easily converted (the scheduler, call wheel, timeout calculations for ISDN connections :-}). Martin