SOURCE

function _throttle(fn,t) {
    let timer = null
    return function () {
        if(!timer){
            timer = setTimeout(() => { 
                fn();
                timer = null;
            }, t);
        }
    };
}

window.addEventListener('mousemove', _throttle(function(){
    console.log(1);                                   
},2000));
console 命令行工具 X clear

                    
>
console