# Use of gettimer

**URL:** <https://forum.kirupa.com/t/use-of-gettimer/194537>\
**Category:** Uncategorized\
**Created:** [July 24, 2006, 1:55pm UTC](https://forum.kirupa.com/t/use-of-gettimer/194537 "2006-07-24T13:55:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leb](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@leb](https://forum.kirupa.com/u/leb)\
**Post date:** [July 24, 2006, 1:55pm UTC](https://forum.kirupa.com/t/use-of-gettimer/194537/1 "2006-07-24T13:55:21Z")

</div>

i wish to know how to use the gettimer to run my on(press) function…  
let say i have an array consist of 10 elements, and each element will be called for an interval of 2second… how can i actually code it out?  
i’ve tried something with this…

for (i=0;i\<array.length;i++){  
{A=gettimer()  
if (gettimer()\>2000)  
{//run action  
}  
}

but it doesnt work…
