# isTimer (Compartilhado)

> Diz se um timer ainda existe neste recurso.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Função Lua
- **Lado**: Compartilhado
- **Categoria**: Tempo e assíncrono
- **URL**: https://wiki.mymp.gg/pt/isTimer

## Sintaxe

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

## Parâmetros

| Nome | Tipo | Descrição |
| --- | --- | --- |
| `timer` | `timer` | O timer, o número que `setTimer` devolveu. |

## Retorno

`true` se o timer existe, `false` se terminou, foi cancelado ou nunca existiu.

## Exemplo

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

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

## Veja também

- [setTimer (Compartilhado)](https://wiki.mymp.gg/pt/setTimer.md): Chama uma função depois de um intervalo, uma vez ou repetidamente.
- [killTimer (Compartilhado)](https://wiki.mymp.gg/pt/killTimer.md): Cancela um timer antes de ele terminar.
- [getTimers (Compartilhado)](https://wiki.mymp.gg/pt/getTimers.md): Lista os timers ativos do recurso que chama.
