# delayMicroseconds()

{% hint style="success" %}
MWSDK2020\_05 には含まれません。対応パッケージはMWSDK\_2020\_07\_UNOFFICIAL以降となります。
{% endhint %}

ポーリングによる時間待ちを行います（μ秒指定）。

```cpp
void delayMicroseconds(uint32_t microsec)
```

`microsec`にて与えられた期間待ち処理を行います。

時間の計測はTickTimerのカウントによって行っています。また長い時間待ちを行う場合はCPUのクロックを低下してポーリング処理を行います。

{% hint style="warning" %}
`setup(), wakeup()`関数内では、TickTimerがまだ動作していないため、whileループによる時間待ち処理になります。この場合、指定値との誤差は大きくなります。このループカウンタは32Mhzに合わせて調整しています。これら関数内でCPUクロックを変化させた場合は、そのクロックに比例した誤差が発生します。

パラメータに10以下といった短い時間を指定した場合は、誤差が大きくなる場合があります。
{% endhint %}


---

# 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/api-reference/funcs/systemfunc/delaymicroseconds.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.
