Need some help with millis

Hello,
I currently doing a project in my school and I have some problems with millis, how long the button is pressed.
I'm completely desperate :confused: , I'm working on this for more than 4 weeks. I did it before with delay() it was really long and almost done ,but my project-professor? said it's not so good and I should do it differently.(+ there was a bug I couldn't find out how to solve it).
I'm still a noob in Arduino and my native language is not english , so sorry for my mistakes , I'm trying my best :slight_smile:
I'm going to explain what it should do.

1.When you upload the code it should say in the Serial.print the value "0".

2.When the button is pushed for less than ~ 0,1-1 seconds the Serial.print should say the value "10".
When the button is pressed again for less than ~ 0,5-1 seconds it should get "0" again.
Like a "light switch."

3.When the button is pushed for less than ~ 0,1-1 seconds the Serial.print should say the value "10".
When the button is pressed again for example 4 seconds it should get "6" .
When you press it again it should say "0".

4.When the button is pressed for example for 5 seconds the Serial.print should say the value "5".
When the button is pressed for example 2 seconds Serial.print should say "3".
When you press it again it should say "0".

  1. The max value it can get is 10, so if you would press it for 20 seconds it should be 0 again ( 15 seconds would be 5 etc.)

I hope you can help me :slight_smile:

Can you post the code you have created already (as we want to help but are not doing your homework)