# loop a function based on a time variable?

**URL:** <https://forums.unrealengine.com/t/loop-a-function-based-on-a-time-variable/300731>\
**Category:** Audio\
**Tags:** event-firing, timer, unreal-engine, loop, question, Blueprint\
**Created:** [December 6, 2014, 1:49am UTC](https://forums.unrealengine.com/t/loop-a-function-based-on-a-time-variable/300731 "2014-12-06T01:49:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrgs5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mrgs5](https://forums.unrealengine.com/u/mrgs5)\
**Post date:** [December 6, 2014, 1:49am UTC](https://forums.unrealengine.com/t/loop-a-function-based-on-a-time-variable/300731/1 "2014-12-06T01:49:31Z")

</div>

so yeah, is it possible to loop a function or custom event based on an amount of time?  
eg.  
hold fire button \> goes to function \> performs things like update ammo, calculate shot distances, play animation \> waits 1 second of gameplay (fire button is still held) \> plays function again.

and repeat like this till fire button is released.  
the only bit i don’t know how to get is this bit \> waits 1 second of gameplay (fire button is still held)
