Start an event when screen changes in code org

I am making a countdown timer. The timer is done, but I cant find ways to start it without a clicking a button. The timer should start when the home page changes and goes to the question screen.
Any ideas to find a solution to this problem ?

Are you using layout or arrangement or different screens?

Where do (in which screen) the timer is present?