Press and hold a button for 2 seconds and it flashes

Hello
The mother of all time handlers used inside the Arduino Biotop is based onto the IDE example "BlinkWithOutDelay".
This simple example can extentend to your needs simply.