This commit is contained in:
Stephan Maier
2024-08-27 08:10:27 +02:00
parent eb5c2fa502
commit 647f938eee
617 changed files with 73086 additions and 7137 deletions

View File

@@ -0,0 +1,32 @@
// <copyright file="EventDelay.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.Global.UserInterface.HotkeyTextboxControl
{
using System;
public class EventDelay
{
private readonly long waitTime;
private long lastCheck;
public EventDelay(long ticks)
{
waitTime = ticks;
}
public bool Check()
{
#pragma warning disable CA2002
lock (this)
#pragma warning restore CA2002
{
long now = DateTime.Now.Ticks;
bool isPassed = now - lastCheck > waitTime;
lastCheck = now;
return isPassed;
}
}
}
}