# resetTimer (Shared)

> Starts a timer's countdown over, with the same interval. The repeats left do not change.

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

## Syntax

```lua
bool resetTimer(timer timer)
```

## Parameters

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

## Returns

`true` if the timer was reset, `false` if it does not exist in this resource.

## Example

```lua
local idle = setTimer(function()
    outputDebugString("idle for 5 minutes")
end, 300000, 1)

addEventHandler("onClientKey", root, function()
    resetTimer(idle)
end)
```

## See also

- [setTimer (Shared)](https://wiki.mymp.gg/en/setTimer.md): Calls a function after an interval, once or repeatedly.
- [getTimerDetails (Shared)](https://wiki.mymp.gg/en/getTimerDetails.md): Reads a timer's state: how long is left, how many repeats remain and its interval.
- [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.
