[OmniOS-discuss] MEDIA: Time, but Faster

Bob Friesenhahn bfriesen at simple.dallas.tx.us
Tue Apr 18 13:41:42 UTC 2017


On Tue, 18 Apr 2017, John D Groenveld wrote:
> | it is, is simply too slow for microsecond-level timing, even at the
> | lower 119.8ns/op (nanoseconds per operation) number above. Note that
> | gettimeofday () supports only microsecond-level accuracy and thus is
> | not suitable for timing faster operations.

I am looking forward to less overhead to get the time.

The gettimeofday() function is a legacy function.  The clock_gettime() 
function should be the preferred way to get the current time in a 
portable way.  This can provide nanosecond precision, but there is no 
telling what the actual precision is (clock_getres() is supposed to 
reveal that).  The CLOCK_HIGHRES clock is the same as that used by 
gethrtime().  It would be good if some of the additional clocks as 
provided by Linux and FreeBSD are added to Illumos.

Bob
-- 
Bob Friesenhahn
bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


More information about the OmniOS-discuss mailing list