# How can I stop a looping Timer?

**URL:** <https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348>\
**Category:** C++\
**Tags:** timer, unreal-engine, question, CPP\
**Created:** [March 5, 2015, 9:38am UTC](https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348 "2015-03-05T09:38:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MSD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/msd/32/88719_2.png) [@MSD](https://forums.unrealengine.com/u/MSD)\
**Post date:** [March 5, 2015, 9:38am UTC](https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348/1 "2015-03-05T09:38:23Z")

</div>

Hi;

In C++ , I have a timer and I set it’s **looping** value to true :

```
...

GetWorldTimerManager().SetTimer(FTimerDelegate::CreateUObject(this, &AES_ScorBot::ObstacleTimerHandler), 5.0f, true);

....

void AES_ScorBot::ObstacleTimerHandler()
{
     if (!bHandleObstacle)
     {
          // HERE , I WOULD LIKE TO STOP THIS TIMER.....
     }
}

```

How can I stop this timer?

Thanks.

MSD

---

<div class="post-metadata">

**Author:** ![BaderThanBad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BaderThanBad](https://forums.unrealengine.com/u/BaderThanBad)\
**Post date:** [March 5, 2015, 9:58am UTC](https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348/2 "2015-03-05T09:58:55Z")

</div>

Save the FTimerDelegate you are creating, then it is as simple as:

```
GetWorldTimerManager().ClearTimer(YourFTimerDelegate);

```

You can even check if the timer is active and much more, look up documentation :).

---

<div class="post-metadata">

**Author:** ![MSD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/msd/32/88719_2.png) [@MSD](https://forums.unrealengine.com/u/MSD)\
**Post date:** [March 5, 2015, 10:08am UTC](https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348/3 "2015-03-05T10:08:12Z")

</div>

Thanks BaderThanBad :  
GetWorldTimerManager().ClearTimer( this, &AES\_ScorBot::ObstacleTimerHandler);

---

<div class="post-metadata">

**Author:** ![BaderThanBad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BaderThanBad](https://forums.unrealengine.com/u/BaderThanBad)\
**Post date:** [March 5, 2015, 10:13am UTC](https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348/4 "2015-03-05T10:13:13Z")

</div>

Just a quick note, 4.7.1 now uses FTimerHandle instead of what you are doing now (FTimerDelegate) which is tagged as deprecated :).

---

<div class="post-metadata">

**Author:** ![vishal-ahirwar](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vishal-ahirwar/32/634878_2.png) [@vishal-ahirwar](https://forums.unrealengine.com/u/vishal-ahirwar)\
**Post date:** [October 19, 2021, 2:42pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348/5 "2021-10-19T14:42:48Z")

</div>

FTimerHandle timer;  
You can clear it using  
GetWorldTimerManager().ClearTimer(timer)  
Well ! thanks for asking 😌

---

<div class="post-metadata">

**Author:** ![AlexanderSt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexanderst/32/465118_2.png) [@AlexanderSt](https://forums.unrealengine.com/u/AlexanderSt)\
**Post date:** [November 13, 2023, 6:28pm UTC](https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348/6 "2023-11-13T18:28:03Z")

</div>

in current Unreal Engine \> 5.1 we can use this:

```auto
GetWorld()->GetTimerManager().ClearTimer(LoadingTimerHandle);

```

---

<div class="post-metadata">

**Author:** ![Maciek\_Leto](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/maciek_leto/32/1194559_2.png) [@Maciek\_Leto](https://forums.unrealengine.com/u/Maciek_Leto)\
**Post date:** [August 29, 2024, 6:33am UTC](https://forums.unrealengine.com/t/how-can-i-stop-a-looping-timer/309348/7 "2024-08-29T06:33:47Z")

</div>

Thanks! This effectively gives us the same functionality as the blueprint `Clear and Invalidate Timer by Handle` node.  
In `AActor` derived classes we can use the short form:

```auto
GetWorldTimerManager().ClearTimer(Handle);

```
