if you check every 100ms for 3 seconds(3000ms) then you can setup a timeVar to increment every 100ms and if the value is 3000/100 =30 then its been held down the entire time.
You can also simple have it stop when the button goes low.
but if you do it by using a variable and counting you can achieve more like...
1 second the var would be 10
2 seconds the var would be 20
3 seconds the var would be 30
Then you can check to see where the value is in between and have different function easy