let fn = () => { console.log('执行SI'); } function setTimeToInterval(fn, delay, times) { if (!times) { return } setTimeout(() => { fn() setTimeToInterval(fn, delay, --times) }, delay) } setTimeToInterval(fn, 2000, 3)