# getTimerDetails (Shared)

> Reads a timer's state: how long is left, how many repeats remain and its interval.

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

## Syntax

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

## Parameters

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

## Returns

Three values: the milliseconds until the next call, the repeats left (`0` if it repeats forever) and the interval in milliseconds. `false` if the timer does not exist in this resource.

## Example

```lua
local round = setTimer(function()
    outputDebugString("round over")
end, 120000, 1)

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

## See also

- [setTimer (Shared)](https://wiki.mymp.gg/en/setTimer.md): Calls a function after an interval, once or repeatedly.
- [resetTimer (Shared)](https://wiki.mymp.gg/en/resetTimer.md): Starts a timer's countdown over, with the same interval. The repeats left do not change.
- [setTimerPaused (Shared)](https://wiki.mymp.gg/en/setTimerPaused.md): Pauses or resumes a timer. While paused it keeps the time it had left and is not called.
