Time for Touching

Member
Posts: 21
Joined: 2008.10
Post: #1
So UITouch events have a helpful method timestamp.

From the docs:

"The value of this property is the time, in seconds, since system startup the touch either originated or was last changed. You can store and compare the initial value of this attribute to subsequent timestamp values of the UITouch instance to determine the duration of the touch and, if it is being swiped, the speed of movement. "


Unfortunately, the timestamp will not tell you the time when the touch ended.

Is there a function I can call inside the touchesEnded method that would give me the equivalent time?
Quote this message in a reply
Member
Posts: 21
Joined: 2008.10
Post: #2
So I found a different solution, called MachTimer, which provides a different timing interface.

http://discussions.apple.com/thread.jspa...ID=7806800

Can't use the timestamp property of the UITouch event now, but it gets the job done.
Quote this message in a reply
Member
Posts: 21
Joined: 2008.10
Post: #3
even better, from some accelerometer code in the GLPaint demo

CFAbsoluteTimeGetCurrent() // returns the system time


Don't know why I didn't see that earlier.
Quote this message in a reply
Post Reply