Hi
Im using the following code to count up when I trigger an event in my application such as “touch”
Instead system.getTimer gets timer from when the app starts, is there not a way to get the time then the event is triggerred?
local t1 = system.getTimer()
local function runningTime(event)
local t2 = system.getTimer()
local ms = t2 - t1
t1 = ms - t2
local floor = math.floor
local seconds = floor(ms / 1000)
local minutes = floor(seconds / 60); seconds = floor(seconds % 60)
local hours = floor(minutes / 60); minutes = floor(minutes % 60)
formattedTime = string.format("%02d:%02d:%02d", hours, minutes, seconds)
stopwatch.text = tostring(formattedTime)
end
if count == 1 then
local timer1 = timer.performWithDelay(1000, runningTime, 0,isFps60)
[import]uid: 43191 topic_id: 7912 reply_id: 307912[/import]