function throttle(func, delay) {
	// console.log(111);
	let timer = null;
	let lastRunTime = 0;

	return function() {
		let context = this;
		let args = arguments;
		let currentTime = Date.now();

		clearTimeout(timer);

		if (currentTime - lastRunTime >= delay) {
			func.apply(context, args);
			lastRunTime = currentTime;
		} else {
			timer = setTimeout(function() {
				func.apply(context, args);
				lastRunTime = Date.now();
			}, delay);
		}
	};
}

export {
	throttle
}