Hey, im making a timer attached to a button
i have tried a couple of differend types but it does not fill my needs
i also need it to be simple as im not very experienced yet

on(press)
{
timer1 = function()
{
something++;
}
timer1Interval = setInterval(timer1,1000)
}

"something" will now add up every second

now i want to make a max, like 10

if(something > 10)
{
something = 10
}

dont know for sure if the above works in this case, but something like it worked for me when i:
pasted it on the frame itself (as soon i entered the frame it resets to 10
pasted it on a button (as soon i clicked the button it resets to 10

but what ever way or place i try it will not happen
without any kind of event

is there any simple timer that can do this without any event,
or is there a simple function to make it check the timer
every milisecond for updates like:
updater = function blabla,
if(something > 10) blabla
setinterval(repeat,1) anything like that?

thx in advance