Measure how long button (or clip!) is pressed for

Does anybody know a simple way of measuring how long a button has been pressed for - had a look at gettimer but this seems to be an odd way of doing things - basically i want to say

onclick start timing -
offclick end timing

var time = time button was pressed!

any ideas much appreciated… thanks - and if there is a simple solution (FOR ONCE!) that would be really cool!

measure how long button (or clip!) is pressed for

here’s one i made based on the FPS… check it out

you could do a onclick get time on release get time sub one from the other

Yep, that’s the way

myButton.onPress = function () {
start_time = getTimer ();
myButton.onRelease = function () {
end_time = getTimer ();
trace ("The button was pressed for "+(end_time-start_time)+ " milliseconds.");

thanks everyone!