Mac OS X System.nanoTime Improvements
Staffan Larsen
staffan.larsen at oracle.com
Wed May 15 00:31:46 PDT 2013
On 15 maj 2013, at 09:14, Thomas Schatzl <thomas.schatzl at oracle.com> wrote:
> Hi all,
>
> On Wed, 2013-05-15 at 01:35 +0400, Dennis Ushakov wrote:
>> On May 15, 2013, at 12:53 AM, Aleksey Shipilev <aleksey.shipilev at oracle.com> wrote:
>>> Any clue how this performs with the CPU power management interventions?
>> Unfortunately documentation on these functions is very sparse, only topic except usage example says that mach_absolute_time() is absolute time value for current wall clock time in units (https://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/services/services.html#//apple_ref/doc/uid/TP30000905-CH219-CHDGFEFE, Handling Version Dependencies section)
>
> One alternative (not sure if already considered) is clock_get_time()
> with the SYSTEM_CLOCK clock.
> (http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/clock_get_time.html)
>
> It is guaranteed to be increasing and monotonic according to the source
> (http://opensource.apple.com/source/xnu/xnu-344.2/osfmk/mach/clock_types.h)
That file has the following notice in it:
/*
* N.B. This interface has been deprecated and the contents
* of this file should be considered obsolete.
*/
/Staffan
>
> It's precision is nanoseconds, don't know about accuracy or how fast the
> call(s) are.
>
> Maybe this helps,
> Thomas
>
>
More information about the hotspot-dev
mailing list