# getTimerDetails (Compartilhado)

> Lê o estado de um timer: quanto falta, quantas repetições sobram e o intervalo.

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

## Sintaxe

```lua
float|false getTimerDetails(timer timer)
```

## Parâmetros

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

## Retorno

Três valores: os milissegundos até a próxima chamada, as repetições que faltam (`0` se repete para sempre) e o intervalo em milissegundos. `false` se o timer não existe neste recurso.

## Exemplo

```lua
local round = setTimer(function()
    outputDebugString("fim da rodada")
end, 120000, 1)

addCommandHandler("timeleft", function()
    local left = getTimerDetails(round)
    if left then
        outputDebugString(math.ceil(left / 1000) .. " segundos restantes")
    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.
- [resetTimer (Compartilhado)](https://wiki.mymp.gg/pt/resetTimer.md): Recomeça a contagem de um timer do zero, com o mesmo intervalo. As repetições que faltam não mudam.
- [setTimerPaused (Compartilhado)](https://wiki.mymp.gg/pt/setTimerPaused.md): Pausa ou retoma um timer. Pausado, ele guarda o tempo que faltava e não é chamado.
