• 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
Time measurement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Time measurement


  • Subject: Time measurement
  • From: Daniel Luis dos Santos <email@hidden>
  • Date: Tue, 2 Dec 2008 07:08:50 +0000

Hello,

Not sure I should ask this here.

How do I get time measurements in milliseconds? What is the accuracy of the mac's C library implementation ?

I am using the clock() function from time.h and measuring differences in seconds between the trigering of a NSTimer.

The NSTimer fires every 0.1 secs, and in the event code I measure the difference between the current clock() call and the previous. I then divide it by the CLOCKS_PER_SEC constant and get two orders of magnitude difference than the interval in the timer. I get 0.001 secs instead of the 0.1 of the NSTimer.

Any ideias ?

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Time measurement
      • From: Dave DeLong <email@hidden>
    • Re: Time measurement
      • From: Rob Keniger <email@hidden>
  • Prev by Date: Re: ???&amp ??? in ICARegisterForEventNotification Apple Code Sample
  • Next by Date: Re: Time measurement
  • Previous by thread: Re: ???&amp ??? in ICARegisterForEventNotification Apple Code Sample
  • Next by thread: Re: Time measurement
  • Index(es):
    • Date
    • Thread