Determine whether to click the event quickly

private static long lastClickTime; 
// The interval between two clicks cannot be less than 1000ms 
private static final int FAST_CLICK_DELAY_TIME = 1500; 

/** 
 * Whether to click continuously 
 */ 
public static boolean isFastClick() { 
   long currentTime = System.currentTimeMillis();// Current time 
   long timeInterval = currentTime-lastClickTime; 
   if (0 <timeInterval && timeInterval <FAST_CLICK_DELAY_TIME) { 
      return true;//If the interval is within 0-1.5 seconds, it means clicking repeatedly quickly 
   } 
   lastClickTime = currentTime; 
   return false; 
}

Guess you like

Origin blog.csdn.net/qq_26280383/article/details/114867559