> For the complete documentation index, see [llms.txt](https://docs.intrepidcs.com/vspy-3-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.intrepidcs.com/vspy-3-documentation/3.9.11/vehicle-spy-main-menus/main-menu-scripting-and-automation/c-code-interface/c-code-interface-functions-and-events/functions-and-events-timers.md).

# Functions and Events: Timers

Timers generate events at specific time.  This time can be periodic or a one shot. The timer can be setup in Vehicle Spy totally or you can optionally control it with C functions. The table below shows the properties of the timer you can set in Vehicle Spy. The timer functions include the ability to read and write the current time and the ability to enable the timer.

**Table 1: Timer Properties that can be Configured in Vehicle Spy**

| Timer Property | Description                                      |
| -------------- | ------------------------------------------------ |
| Name           | Name of the timer in C code.                     |
| Description    | Description of what the timer does.              |
| Type           | Periodic or One shot.                            |
| RunAtStart     | Should the timer run when Vehicle Spy Starts.    |
| Initial Period | The period of the timer when Vehicle Spy Starts. |
| Resolution     | Millisecond or Microsecond timer resolution.     |

![Figure 1: Timer Functions to control the timer using C code.](https://2673726158-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdYdvinhoJh0IN6rV8uo3%2Fuploads%2FW3lfUx8HvJrw2xytbB2g%2Ftimer_functions.gif?alt=media\&token=3cc89f63-bd76-4b8d-b68d-b65fa68e9026)

![Figure 2: The Timer Events tab allows you to create a timer event at regular or single shot intervals.](https://2673726158-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdYdvinhoJh0IN6rV8uo3%2Fuploads%2F97Ibll2cbKVBZdLmaDse%2Ftimer_event.gif?alt=media\&token=d3e406c5-8885-44f6-9780-e3d0e67cacf8)

![Figure 3: The timer event is a simple function with no arguments that is called when the timer expires.](https://2673726158-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdYdvinhoJh0IN6rV8uo3%2Fuploads%2FVxoXeYwPnIzuQPDOC8kT%2Ftimer_event_code.gif?alt=media\&token=3aa4697f-a3de-4969-9ea4-74c8c2ccfa09)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.intrepidcs.com/vspy-3-documentation/3.9.11/vehicle-spy-main-menus/main-menu-scripting-and-automation/c-code-interface/c-code-interface-functions-and-events/functions-and-events-timers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
