Hello,
use Timer for this purpose. When the user presses the button the timer should start. When the user releases the button, the timer should stop. To achieve this assign the timers slot method StartTimer to the button's property OnPress. Then assign the timer's slot method StopTimer to the buttons OnRelease property. Both steps are demonstrated below (see also Start, stop and restart the Timer object and Implement Push Button's slot methods):
Then add a new slot method and assign it to the timer's OnTrigger property. In the slot method you can implement the code you want to be executed with the delay or periodically.
Finally configure the timing of the timer. With the property Begin you specify the initial timer delay. With the property Period you can specify the timer interval. See also Specify the timer interval and the initial delay.
I hope it helps you further.
Best regards
Paul Banach