• 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: capturing user reaction times in msecs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: capturing user reaction times in msecs


  • Subject: Re: capturing user reaction times in msecs
  • From: David Duncan <email@hidden>
  • Date: Tue, 19 Dec 2006 10:12:41 -0800

On Dec 19, 2006, at 9:20 AM, Shawn Erickson wrote:

UInt64 startTime = UnsignedWideToUInt64(AbsoluteToNanoseconds(UpTime ()));
... do your thing...
UInt64 endTime = UnsignedWideToUInt64(AbsoluteToNanoseconds(UpTime ()));


UInt64 elapsedTime = (endTime - startTime); // elapsed time in nanoseconds

You will get slightly more accurate timing with

AbsoluteTime startTime = UpTime();
... do your thing...
AbsoluteTime endTime = UpTime();

UInt64 elapsedTime = UnsignedWideToUInt64(AbsoluteToNanoseconds (SubAbsoluteFromAbsolute(endTime, startTime)));

This way you do as little work as possible between when you capture the start time and the end time.
--
David Duncan
Apple DTS Quartz and Printing
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: capturing user reaction times in msecs
      • From: Nir Soffer <email@hidden>
References: 
 >Re: capturing user reaction times in msecs (From: julia Cline <email@hidden>)
 >Re: Re: capturing user reaction times in msecs (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: Using bindings to make an NSPopupButton to assign an array filter predicate
  • Next by Date: Re: Using bindings to make an NSPopupButton to assign an array filter predicate
  • Previous by thread: Re: Re: capturing user reaction times in msecs
  • Next by thread: Re: capturing user reaction times in msecs
  • Index(es):
    • Date
    • Thread