# isTimer (Shared)

> Tells whether a timer still exists in this resource.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Timers and async
- **URL**: https://wiki.mymp.gg/en/isTimer

## Syntax

```lua
bool isTimer(timer timer)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `timer` | `timer` | The timer, the number `setTimer` returned. |

## Returns

`true` if the timer exists, `false` if it ended, was cancelled or never existed.

## Example

```lua
local countdown = setTimer(function()
    outputDebugString("go")
end, 5000, 1)

addCommandHandler("abort", function()
    if isTimer(countdown) then
        killTimer(countdown)
    end
end)
```

## See also

- [setTimer (Shared)](https://wiki.mymp.gg/en/setTimer.md): Calls a function after an interval, once or repeatedly.
- [killTimer (Shared)](https://wiki.mymp.gg/en/killTimer.md): Cancels a timer before it ends.
- [getTimers (Shared)](https://wiki.mymp.gg/en/getTimers.md): Lists the calling resource's active timers.
