Press and hold a button for 2 seconds and it flashes

My idea is that at the moment of pressing the button, it starts a timer that counts the time since it was pressed until it stops being pressed, everything was going well but I have a problem with the time conditions because the Arduino thinks that if I put a maximum value it will take all the values below it.
My conflict is that I do not know how to make a loop because I am new to this.