# How to stop :timer

**URL:** <https://forum.elixirforum.com/t/how-to-stop-timer/48290>\
**Category:** Questions\
**Tags:** erlang, phoenix, liveview\
**Created:** [June 9, 2022, 7:51am UTC](https://forum.elixirforum.com/t/how-to-stop-timer/48290 "2022-06-09T07:51:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![LostKobrakai](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lostkobrakai/32/3072_2.png) [@LostKobrakai](https://forum.elixirforum.com/u/LostKobrakai)\
**Post date:** [June 9, 2022, 7:53am UTC](https://forum.elixirforum.com/t/how-to-stop-timer/48290/2 "2022-06-09T07:53:14Z")

</div>

Timers are not identified my the message they send, but the reference returned when starting the timer.

```elixir
ref = :timer.send_interval(1000, self(), :tick)
:timer.cancel(ref)

```

In your case you’d need to retain the reference in your state, e.g. in `socket.private`.

---

_[View the full topic](https://forum.elixirforum.com/t/how-to-stop-timer/48290)._
