Program using a button timer

I am using an esp32. I have a pull up resistor in my circuit and we are doing event driven programming so even though I know the code you posted works, I'm supposed to use the structure of the code I posted. :frowning: