定时器 间隔函数setinterval()

发布时间 2023-03-29 15:20:36作者: 1502god

就是设置一个时间(以毫秒为单位),等待数秒后再次执行回调函数

use

<body>
    <script>
        const huidao = setInterval(function(){
            console.log(123);
        },1000)

        //第二种方式
        // const huidiao  = setInterval(() => {
        //     console.log('11111');
        // }, 1000);
    </script>
</body>
</html>