Re: capturing user reaction times in msecs
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