Also if you want to show a timer during the gameplay itself, just do the same thing but calculate the timeSpentInGame in an enterFrame listener:
--this must NOT be local to the start game function, as you will need to access it in the exit game function local startTime --create a text object to display the timer local myTimeText = display.newText("0", 100, 100, native.systemFont, 50) local function startGame() --get time that the game started startTime = system.getTimer() end local function update() --get the current time local now = system.getTimer() --calculate time in milliseconds spent in game local timeSpentInGame = now - startTime --convert to seconds if that is useful for you local secondsInGame = timeSpentInGame / 1000 --update the text object to show the number of seconds myTimeText.text = secondsInGame end startGame() Runtime:addEventListener("enterFrame", update)