Long press, add/subtract value

I want to use a button to add and one button to subtract values to a number. When i use touch event it works fine for single presses on the buttons. But if i want it to repeat adding/subtracting values when the buttons is pressed down (long press), how would i go about doing that?

I have one add- and on subtract function, so i was thinking about calling the functions with a timer on the began event, but i guess there most be a much better solution to this. Someone who can help me out?

I recommend that you start a timer when the key is pressed down that updates your value at an interval of your choosing, say 250 milliseconds.  You should cancel the timer when the key is released.  I think this is the best way to handle it, especially from a cross-platform consistency standpoint.

   http://docs.coronalabs.com/api/library/timer/performWithDelay.html

   http://docs.coronalabs.com/api/library/timer/cancel.html

I recommend that you start a timer when the key is pressed down that updates your value at an interval of your choosing, say 250 milliseconds.  You should cancel the timer when the key is released.  I think this is the best way to handle it, especially from a cross-platform consistency standpoint.

   http://docs.coronalabs.com/api/library/timer/performWithDelay.html

   http://docs.coronalabs.com/api/library/timer/cancel.html