# Latency and execution speed “debounce mechanism”

**What determines the speed of error detection in WProofreader?**

The speed at which WProofreader highlights grammar and spelling mistakes is influenced by the way text input is processed and the user's browser capabilities. Here's a detailed breakdown:

**Sentence definition:** A sentence is any text string ending with a punctuation mark such as period, exclamation mark, question mark (`.!?`) or a line break (`/n`), followed by a space and either a capitalized word or the end of a paragraph.

**Request timing:**

* Immediate: Requests are sent to the server instantly after a sentence ends with a punctuation mark (`.!?`) followed by a space.
* Delayed: If typing stops, requests are sent after a 500 ms pause.

**What is the debounce mechanism?**

The debounce mechanism is designed to manage the timing of requests to optimize performance without overloading the application server:

* For extensive edits (modifications covering more than one paragraph), there’s a 2000 ms delay before a request is sent.
* For minor edits, a delay of 500 ms is applied.
* For completed sentences (ending with a punctuation mark and space), there is no delay.

**Factors affecting response time:**

Response time is affected by factors such as the length of text, language, number of errors, and the type of check (e.g., spelling, grammar, style).

The debounce mechanism, featuring fixed delays of 500 ms for minor changes and 2000 ms for extensive edits, ensures efficient processing and timely feedback, taking into account the user's browser and server capacity.

{% hint style="warning" %}
The settings for the debounce delay are fixed and cannot be altered.
{% 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://docs.wproofreader.com/integrations/initialization/latency-and-execution-speed-debounce-mechanism.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.
