Emme Developer Well-Known Member Licensed User Longtime User Nov 14, 2017 #1 Hi, is more recommended use a timer with 1 minute ticks, or use a while true with a sleep of 1 minute? Why? Thanks
Hi, is more recommended use a timer with 1 minute ticks, or use a while true with a sleep of 1 minute? Why? Thanks
NJDude Expert Licensed User Longtime User Nov 14, 2017 #2 Use a timer, timers do not hold the main thread. Upvote 0
Emme Developer Well-Known Member Licensed User Longtime User Nov 14, 2017 #4 DonManfred said: What do you want to archieve? Click to expand... Nothing special, only want to understand which is heavier on the computational level Upvote 0
DonManfred said: What do you want to archieve? Click to expand... Nothing special, only want to understand which is heavier on the computational level
Erel B4X founder Staff member Licensed User Longtime User Nov 14, 2017 #5 Sleep also doesn't hold the main thread. The performance of both will be very similar. Advantage of Timer is that you can enable or disable it. Advantage of Sleep is that you can run it inside the current sub. Use whichever one is more convenient for you. Upvote 0
Sleep also doesn't hold the main thread. The performance of both will be very similar. Advantage of Timer is that you can enable or disable it. Advantage of Sleep is that you can run it inside the current sub. Use whichever one is more convenient for you.