In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how WeChat Mini Programs realizes the timer of the position alarm". The content is simple and clear. I hope it can help you solve your doubts. Next, let me lead you to study and learn the article "how WeChat Mini Programs realizes the timer of the position alarm".
Demand
After setting the position of the monitoring point, we need to obtain the position of the equipment according to a certain time interval, and compare with the set monitoring point, and trigger the corresponding action if there is a qualified monitoring point. In order to achieve the above functions, we first need to achieve the function of doing something at a certain time interval-timer.
Description
Function startTimer (interval, onTimer) {
Var time = setTimeout (function () {
OnTimer ()
StartTimer (interval, onTimer)
}
Interval
)
}
The setTimeout function is called inside the function startTimer, which takes two parameters: one is the callback function (to borrow C language) that is called when Timeout occurs, and the other is the time interval, in milliseconds.
After the startTimer is executed, the system starts timing. When the specified event interval has passed, the callback function is executed: the onTimer function is first called, which is specified by the user of the startTimer. Next, the startTimer function is called again to start the next timer action. Over and over again.
It is easy to use, for example, you can use the startTimer function as follows.
OnLoad:function () {
StartTimer (1000) function () {
Console.log ("OnTimer!")
});
}
Although it is only the output of log at present, we will use this as the entrance in the next few days to achieve the function of regularly obtaining the current location and confirming the monitoring point.
The above is all the contents of the article "how to realize the timer of the position alarm by WeChat Mini Programs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.