当前位置:网站首页>Seconds understand the delay and timing function of wechat applet
Seconds understand the delay and timing function of wechat applet
2022-07-07 02:03:00 【Full stack o-jay】
The time delay function , Print once in two seconds “hello”.
setTimeout(()=>
{
console.log("hello");
}, 2*1000);
Timing function , Print every two seconds “hello”.
setInterval(()=>
{
console.log("hello");
}, 2*1000);
If you want to Cancel timing function , be
var k = setInterval(()=>
{
console.log("hello");
}, 2*1000);
clearInterval(k);
The above function can cancel the timer ,k It's a timer id.
边栏推荐
- Cat recycling bin
- Reptile practice (VI): novel of climbing pen interesting Pavilion
- ROS学习(21)机器人SLAM功能包——orbslam的安装与测试
- Threadlocalutils (tool class IV)
- C语言关于链表的代码看不懂?一篇文章让你拿捏二级指针并深入理解函数参数列表中传参的多种形式
- Zabbix 5.0:通过LLD方式自动化监控阿里云RDS
- 开发中对集合里面的数据根据属性进行合并数量时犯的错误
- Basic introduction and use of dvajs
- 猫猫回收站
- RC振荡器和晶体振荡器简介
猜你喜欢
ROS learning (XIX) robot slam function package cartographer
MySQL execution process and sequence
BigDecimal 的正确使用方式
@Before, @after, @around, @afterreturning execution sequence
刨析《C语言》【进阶】付费知识【二】
我如何编码8个小时而不会感到疲倦。
Flir Blackfly S 工业相机:配置多个摄像头进行同步拍摄
Blackfly S USB3工业相机:缓冲区处理
Stm32f4 --- general timer update interrupt
ROS学习(24)plugin插件
随机推荐
Blackfly S USB3工业相机:缓冲区处理
Halcon knowledge: segment_ contours_ XLD operator
Analyze "C language" [advanced] paid knowledge [End]
2022 system integration project management engineer examination knowledge point: Mobile Internet
新工作感悟~辞旧迎新~
Hutool post requests to set the body parameter to JSON data
Errors made in the development of merging the quantity of data in the set according to attributes
MySQL's most basic select statement
Set WordPress pseudo static connection (no pagoda)
454 Baidu Mianjing 1
How can I code for 8 hours without getting tired.
Time synchronization of livox lidar hardware -- PPS method
制作带照明的DIY焊接排烟器
Treadpoolconfig thread pool configuration in real projects
传感器:DS1302时钟芯片及驱动代码
POJ 3177 redundant paths POJ 3352 road construction (dual connection)
JS Es5 can also create constants?
Flir Blackfly S 工业相机:通过外部触发实现多摄像头同步拍摄
How did partydao turn a tweet into a $200million product Dao in one year
Drag to change order