Throttling: There must be a time interval between two successful adjacent calls. If there is no time interval or the time does not match the custom time, the call is invalid

Usage:

Const timeStart const dt = date.now () if(dt-this.timestart > 500){this.doajax () this.timestart = dt}else{ Console. log(' current timestamp is ',dt,' less than 500ms since last execution, not executed ') return}Copy the code

If the time is longer than the user-defined time, the request is allowed to be sent. If the time is shorter than the user-defined time, the request is returned