Use the time() command. Have variables called starttime, currenttime, and elapsedtime. Put a starttime = time() right at the beginning before your main loop, put a currenttime = time() inside your main loop, and then just remember that elapsedtime = currenttime-starttime. Making starttime=currenttime will reset the counter (don’t do that every loop though, obviously), and if you just want seconds, then secondscounter = elapsedtime%60
The % means ‘modulo’ , btw. Google it, it’s very useful!