College exercise using a switch

Hey guys, I'm having trouble doing an exercise for my college project and I would like to ask if you could help me.

I'm supposed to connect a switch to a digital entry with an internal pull-up resistance (e.g. pinMode(DX, INPUT_PULLUP)), and I should create and test a code (with a metod called STATE) which makes me able to read the button's recent state every second, as well as its associated moment of time. Therefore it should print both time and the buttons state on the series monitor (in a csv format).
E.g.: While I don't press the button, the monitor prints ("0; 1sec", "0; 2sec", etc.) being "0" the boolean "false", but when I press the button it prints ("1; 3sec", "1, 4sec", etc.).

I would be very thankful if someone helped me :slight_smile:
Thank you for your time

I would be very thankful if someone helped me

Helped you with what?

Wiring the switch? Connect one leg to ground. Connect the other leg to a digital pin.
Reading the state of the switch? Use digitalRead().
Writing the to serial port? Use Serial.print() or Serial.println()?
Getting the time? Use millis().

Paying better attention in class? Nope, sorry, you are on your own.