der_wille_zur_macht
Team RC
I haven't tested it yet, but my concern with this implementation is that it would seem to introduce a 1 second delay between initial button presses, so if you aren't holding it down 1 per second is as fast as you can go. I could be wrong.
Introduce another check if the button was "just" pressed (at which point you'd reset your "when was the button first pressed?" variable) and that problem is solved. Actually I bet you could write the logic in a manner that you wouldn't need a second check. You'd just check for that condition in each iteration of the loop. If the button was JUST pressed, increment the variable and record the timestamp. If the button is down but was not JUST pressed, look at current time vs. the timestamp you recorded.