using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace XHandler.Class { public class EventResponseController { private static EventResponseController _instance; public static EventResponseController Instance => _instance ?? (_instance = new EventResponseController()); private DateTime _lastTime = DateTime.MinValue; public bool CanExecute() { var now = DateTime.Now; if (now.Subtract(_lastTime) < TimeSpan.FromMilliseconds(800)) return false; _lastTime = now; return true; } } }