# TickTimer

TickTimer is used for internal control of TWENET and is implicitly executed. The period of the timer is 1ms. Only the `available()` method is defined in `loop()` for the purpose of describing processing every 1ms by the TickTimer event.

{% hint style="warning" %}
Note that it is not always available in 1ms increments.

There are cases in which events are skipped due to a large delay caused by factors such as the contents of the user program description or the system's internal interrupt processing.

```cpp
void loop() {
  if (TickTimer.available()) {
    if ((millis() & 0x3FF) == 0) { // This may not be processed (could be skipped)
      Serial << '*';
    }
  }
}
```

{% endhint %}

## Methods

available()

```cpp
inline bool available()
```

It is set after the TickTimer interrupt occurs and becomes `true` in the `loop()` immediately following it. It is cleared after `loop()` ends.


---

# Agent Instructions: 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:

```
GET https://mwx.twelite.info/latest_en/api-reference/predefined_objs/ticktimer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
