• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: (RS) hi-res clock function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (RS) hi-res clock function


  • Subject: Re: (RS) hi-res clock function
  • From: Alastair Houghton <email@hidden>
  • Date: Wed, 25 Oct 2006 13:07:39 +0100

On Oct 25, 2006, at 1:00 PM, Alastair Houghton wrote:

On Oct 25, 2006, at 12:48 PM, Roland Silver wrote:

A related experiment shows that the resolution of the GNU clock() function on the PowerBook is no less than 16 usec.

You mean the ISO C clock() function. It isn't a GNU function.

Is there a function like clock() that returns time (since some origin) directly to a finer resolution than clock does?

Take a look at the man page for gettimeofday(2).

Just to add to that, you might find that it doesn't have a higher resolution, in which case you might need to use something system dependent. (The PowerPC timebase register, for instance). It might be worth checking the Mach APIs to see if there's something that lets you do that kind of thing in a non-system-specific manner (you'll need to download xnu and look in the osfmk/man folder for the docs).


Of course, I'm sure someone else will point out some other time API any minute now that fits the bill :-)

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: (RS) hi-res clock function
      • From: Jeff Koftinoff <email@hidden>
References: 
 >(RS) hi-res clock function (From: Roland Silver <email@hidden>)
 >Re: (RS) hi-res clock function (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: (RS) hi-res clock function
  • Next by Date: Re: (RS) hi-res clock function
  • Previous by thread: Re: (RS) hi-res clock function
  • Next by thread: Re: (RS) hi-res clock function
  • Index(es):
    • Date
    • Thread