> For the complete documentation index, see [llms.txt](https://sdk.twelite.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sdk.twelite.info/en/hw-api-ref/perifuraru/ticktimer.md).

# TickTimer

TWELITE NET internally used 16Mhz hardware counter. The timeout time is calculated by [`sToCoNet_AppContext.u16TickHz`](/en/twelite-net-api-ref/gou-zao-ti/stoconet_appcontext.md).

{% hint style="danger" %}
TWELITE NET is used internally and should not be stopped, reconfigured or otherwise changed by the user.
{% endhint %}

{% hint style="info" %}
It can be used for very short time measurements by reading the count value with `uint32 u32AHI_TickTimerRead()`.

```c
uint32 s, e, d, cyc;

// 1ms = 16000 count
cyc = 1000 / sToCoNet_AppContext.u16TickHz;
cyc *= 16000;

// check the process time
s = u32AHI_TickTimerRead();
.. some process ..
e = u32AHI_TickTimerRead();

// calculate the time
if (e > s) {
    d = e - s;
} else {
    d = 64000 - e + s;
}
d /= 16; // now `d' represents micro sec.
```

{% endhint %}


---

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

```
GET https://sdk.twelite.info/en/hw-api-ref/perifuraru/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.
