Chronometer / Timer mode

Hello, I have a problem with a code, if someone can help me. So .. I have to make a project which consists a making a chronometer on a 3 digit 7 segment display and a timer on the same 3 digits and I have to use a toggle switch to change the mode between the chronometer and timer and I really don't know what kind a code I have to use for this. I've attached the code I'm using for my chronometer.. it only counts from 1 to 9 on one 7 segment display if it can help you.
Thank you. I'm most grateful.

Chronometer.txt (3.67 KB)

Why are you looping 50 times, doing the exact same thing each time through the loop?

Your indenting sucks, and the use of multiple } on one line caused me to stop reading.

I'm new at this and I didn't knew how to make it any better.. but thanks.. that was really helpful...