How do I implement a timer in my players dash ability.

I’m making a dash function so when I click the button 2 times the player dashes (like in some other 2d games) and I want to implement a timer so when I click the first time if I don’t click the second time fast enough it resets the dash.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Movement : MonoBehaviour
{
    private Rigidbody2D rigidbody2d;
    float moveSpeed = 5;
    float dashSpeed = 12;
    float dashSpeedUp = 5;
    float dashCount = 0f;

    void Start()
    {
        rigidbody2d = transform.GetComponent<Rigidbody2D>();
    }
    
    void Update()
    {
        Dash();
    }
    private void Dash()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            if (dashCount >= 0)
            {
                dashCount = 0;
                print(dashCount);
            }

            dashCount -= 1;
            print(dashCount);
            if (dashCount == -2)
            {
                rigidbody2d.velocity = new Vector3(-dashSpeed, +dashSpeedUp);
                dashCount = 0;
                print(dashCount);
            }
        }
        
        if (Input.GetKeyDown(KeyCode.D))
        {
            if (dashCount <= 0)
            {
                dashCount = 0;
                print(dashCount);
            }

            dashCount += 1;
            print(dashCount);
            if (dashCount == 2)
            {
                rigidbody2d.velocity = new Vector3(+dashSpeed, +dashSpeedUp);
                dashCount = 0;
                print(dashCount);
            }
        }
    }
}

Maybe the following code can help you:-

    bool dashDown = false;
    float dashExpire = 0.25f;

    void Update()
    {
        // Check if dash button preshed just now
        if (Input.GetButtonDown("Dash"))
        {
            // If it was not pressed before in the timer range
            if (!dashDown)
            {
                // Set bool true and start the timer
                dashDown = true;
                StartCoroutine(ResetDash());
            }
            // Or if the player pressed it in time
            else
            {
                // Reset bool and call dash
                dashDown = false;
                Dash();
            }
        }
    }

    IEnumerator ResetDash()
    {
        yield return new WaitForSeconds(dashExpire);
        dashDown = false;
    }