# getTimerDetails (Compartido)

> Lee el estado de un timer: cuánto falta, cuántas repeticiones quedan y su intervalo.

- **Plataforma**: MY Multiplayer (MYMP)
- **Tipo**: Función Lua
- **Lado**: Compartido
- **Categoría**: Temporizadores y asíncrono
- **URL**: https://wiki.mymp.gg/es/getTimerDetails

## Sintaxis

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

## Parámetros

| Nombre | Tipo | Descripción |
| --- | --- | --- |
| `timer` | `timer` | El timer, el número que devolvió `setTimer`. |

## Retorno

Tres valores: los milisegundos hasta la próxima llamada, las repeticiones que faltan (`0` si se repite para siempre) y el intervalo en milisegundos. `false` si el timer no existe en este recurso.

## Ejemplo

```lua
local round = setTimer(function()
    outputDebugString("fin de la ronda")
end, 120000, 1)

addCommandHandler("timeleft", function()
    local left = getTimerDetails(round)
    if left then
        outputDebugString(math.ceil(left / 1000) .. " segundos restantes")
    end
end)
```

## Ver también

- [setTimer (Compartido)](https://wiki.mymp.gg/es/setTimer.md): Llama a una función después de un intervalo, una vez o repetidamente.
- [resetTimer (Compartido)](https://wiki.mymp.gg/es/resetTimer.md): Vuelve a empezar la cuenta de un timer desde cero, con el mismo intervalo. Las repeticiones que faltan no cambian.
- [setTimerPaused (Compartido)](https://wiki.mymp.gg/es/setTimerPaused.md): Pausa o reanuda un timer. En pausa conserva el tiempo que le faltaba y no se llama.
