package com.emato.ich.utils;

/**
 * 按钮工具类
 */
public class ButtonUtils {

    private static long lastClickTime = 0L;

    /**
     * 防止同时点击按钮出现NPE
     * @return    是否是点的最快的
     */
    public synchronized static boolean isFastClick() {
        long nowClickTime = System.currentTimeMillis();
        boolean flag = false;
        if (nowClickTime - lastClickTime < 500) {
            flag = true;
        }
        lastClickTime = nowClickTime;
        return flag;
    }

}
