> For the complete documentation index, see [llms.txt](https://fecality-api.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fecality-api.gitbook.io/docs/documentation/datatypes/timer.md).

# timer

utils.new\_timer

### Functions <a href="#functions" id="functions"></a>

#### start <a href="#start" id="start"></a>

local timer = utils.new\_timer(100, function()print("This will be printed every 100ms")end)​timer:start()

**Usage:**

Begins the timer.

#### stop <a href="#stop" id="stop"></a>

timer:stop()

**Usage:**

Pauses the timer.

#### run\_once <a href="#run_once" id="run_once"></a>

local timer = utils.new\_timer(100, function()print("This will be printed once")end)​timer:run\_once()

**Usage:**

Run a timer once.

#### is\_active <a href="#is_active" id="is_active"></a>

local timer\_active = timer:is\_active()

**Returns:**

| ​[Value](https://jewls.gitbook.io/fatality-api/documentation/datatypes/timer)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/datatypes/timer)​ |
| ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| timer's state                                                                  | boolean                                                                           |

#### set\_delay <a href="#set_delay" id="set_delay"></a>

local timer = utils.new\_timer(0, function()print("This will be run every 1000ms")end)timer:set\_delay(1000)timer:start()​

| ​[Parameter](https://jewls.gitbook.io/fatality-api/documentation/datatypes/timer)​ | ​[Datatype](https://jewls.gitbook.io/fatality-api/documentation/datatypes/timer)​ | ​[Description](https://jewls.gitbook.io/fatality-api/documentation/datatypes/timer)​ |
| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| delay                                                                              | number                                                                            | the amount of ms to change the timer's delay to                                      |
