---
title: GetDoubleClickTime()
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/event/getdoubleclicktime
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/event/getdoubleclicktime.md
last_updated: 2026-11-18
generated_at: 2026-11-22T12:08:55.378Z
locale: en-us
---

# GetDoubleClickTime()

> Obtains the maximum time, in milliseconds, between two clicks for the second click to count as a double-click.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.UICommonModule

```csharp
public static int GetDoubleClickTime()
```

### Returns

| Type                                                       | Description                                                             |
| ---------------------------------------------------------- | ----------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The maximum time between two clicks of a double-click, in milliseconds. |

### Remarks

On Windows, this is the double-click time configured in the operating system. On other platforms, it's 500 milliseconds.

Unity uses this value to compute [Event.clickCount](/engine/7000.0/script-reference/unityengine/event/clickcount.md) and the click count of UI Toolkit pointer events. UI Toolkit text fields use the click count to place the cursor on a single click, select a word on a double-click, and select a line on a triple click. UI Toolkit list and tree views use it to detect when the user double-clicks or double-taps an item to choose it.

Use this method when you count clicks or taps yourself, so your UI matches the timing of the Unity UI and the user's system settings. For mouse events, [Event.clickCount](/engine/7000.0/script-reference/unityengine/event/clickcount.md) already accounts for this value.

The following example uses this method to detect a double tap on a touchscreen and logs "Double tap" to the Console. The example uses the legacy [Input](/engine/7000.0/script-reference/unityengine/input.md) class, so it requires the Input Manager to be enabled in **Active Input Handling**.

### Examples

```csharp
using UnityEngine;

public class DoubleTapExample : MonoBehaviour
{
    float m_LastTapTime = float.NegativeInfinity;

    void Update()
    {
        if (Input.touchCount == 0 || Input.GetTouch(0).phase != TouchPhase.Began)
            return;

        // Convert the double-click time from milliseconds to seconds to compare it with Time.unscaledTime.
        float doubleClickTime = Event.GetDoubleClickTime() * 0.001f;
        if (Time.unscaledTime - m_LastTapTime < doubleClickTime)
            Debug.Log("Double tap");

        m_LastTapTime = Time.unscaledTime;
    }
}
```
