Elapsed time

How would I measure the time i touched screen

Actually there’s a global variable called ElapsedTime (same as your post title :slight_smile: that you can use to check the amount of time that has elapsed since the program started running.

I know that but I want to know how to measure the time I had touched the screen at a a given touch

Try something like (typed in, not checked in codea)

function touched(touch)
  if touch.state == BEGINNING then
    startTouchTime = ElapsedTime
  end
  if touch.state == ENDED then
    touchedTime = ElapsedTime - startTouchTime
  end
end

then touchedTime would contain the duration. This doesn’t account for multitouch correctly, but should point you in the right dircection.