# killTimer (Shared)

> Cancels a timer before it ends.

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

## Syntax

```lua
bool killTimer(timer timer)
```

## Parameters

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

## Returns

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

## Example

```lua
local reminder = setTimer(function()
    outputDebugString("still here")
end, 60000, 0)

addCommandHandler("quiet", function()
    if isTimer(reminder) then
        killTimer(reminder)
    end
end)
```

## See also

- [setTimer (Shared)](https://wiki.mymp.gg/en/setTimer.md): Calls a function after an interval, once or repeatedly.
- [isTimer (Shared)](https://wiki.mymp.gg/en/isTimer.md): Tells whether a timer still exists in this resource.
- [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.
