Coding a timer that stops when clicked

Hi, I am making a maze game with a timer. It needs to start when the game starts and stop when you reach the end and click on it. I cannot achieve this without the timer disappearing when clicked. I cannot get it to stop and keep the time displayed. Thanks.