On Jun 16, 2008, at 5:47 , Josh de Lioncourt wrote:

Next, I need to be able to keep track of real-time during the game. In Windows, we'd use something like GetTickCount to accomplish this. Is there an equivalent on the Mac side? Again, pointing me in the right direction would be tremendously appreciated.

mach_absolute_time() will give you high precision timing. There's a technote on this subject here: <http://developer.apple.com/qa/qa2004/qa1398.html >

Alternately, you can retrieve the absolute time using UpTime() (found in <CarbonCore/DriverServices.h>, which you'd likely need to import anyway for the conversion routines AbsoluteToNanoseconds() and AbsoluteToDuration().

(I do not know what the difference is, if any, between using mach_absolute_time() and UpTime().)

/brian

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to