how to calculate time of scene remain on screen

hi i m making a game and its scoring in dependent on the time a player is holding ball between two bars

my first problem is that i am not getting the time on which the game is started (i have read some examples but they all are showing the total time the app is lunched ) i only need the time that main game is started.

and second problem is that how should i display data calculated in one scene and display on other scene.

when you start the main game, you can just get the time with something like:

local startTime = system.getTimer()

and whenever you need to know how long it’s been, you can just use:

system.getTimer() - startTime

To share data between scenes, you can just save it in a separate module. Check out this tutorial, specifically the myData bit at the end:

https://coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/

when you start the main game, you can just get the time with something like:

local startTime = system.getTimer()

and whenever you need to know how long it’s been, you can just use:

system.getTimer() - startTime

To share data between scenes, you can just save it in a separate module. Check out this tutorial, specifically the myData bit at the end:

https://coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/