How to create a timer for my quiz app

How to create a timer for my quiz app. i want to do that when count down end automatically submit the form how can i do that?