/* * @Company: hugeInfo * @Author: ldh * @Date: 2022-03-22 14:42:30 * @LastEditTime: 2022-04-26 17:21:02 * @LastEditors: ldh * @Version: 1.0.0 * @Description: 计时器管理 */ class timerHandle { constructor() { this.timer = {}; } setInterval(key, func, interval) { this.timer[key] = setInterval(func, interval); } clearInterval(key) { clearInterval(this.timer[key]); } setTimeout(key, func, interval) { this.timer[key] = setTimeout(func, interval); } clearTimeOut(key) { clearTimeout(this.timer[key]); } } export default new timerHandle();