Hi
I am a bit confused about action "sleep". I want to know about action "sleep". In which type of flows I can use this action? Any clarification?
Thanks in advance.
Action "sleep"
Moderator: Martin
Action "sleep"
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
- digitalstone
- Posts: 342
- Joined: 21 Oct 2017 12:36
- Location: The Netherlands
Re: Action "sleep"
The simplest example is a countdown timer (also stated inside the help section i believe):
In this case of a countdown, you're looping through 10 seconds to 0 seconds let's say...
But you want a second to pass between each second.
In that case you would setup a timer for 1 second.
Now, your phone would normally countdown as fast as the CPU could run through the whole flow, but with the "Sleep" action within it, you're basically saying that it has to wait an entire second between each loop iteration.
Another example would be a "check-counter":
When a flow has been triggered and you want to check-up on afterwards, before you want Automagic to do something else.
You then have to build a continuous cycle of evaluation to check if a certain value has been reached.
like this:

Except... If you would adopt the flow (from the picture) into any digital system, it will strain a LOT of unnecessary calculation from your CPU, because it will run an entire loop EVERY 10ms or so (depending on what you're checking by today's standards).
To make things easier/efficient for your processor, we would like to tell the CPU to sleep until we (we=developers/users/people) decide to check a certain value once again to take a certain action based on that value.
In this case of a countdown, you're looping through 10 seconds to 0 seconds let's say...
But you want a second to pass between each second.
In that case you would setup a timer for 1 second.
Now, your phone would normally countdown as fast as the CPU could run through the whole flow, but with the "Sleep" action within it, you're basically saying that it has to wait an entire second between each loop iteration.
Another example would be a "check-counter":
When a flow has been triggered and you want to check-up on afterwards, before you want Automagic to do something else.
You then have to build a continuous cycle of evaluation to check if a certain value has been reached.
like this:

Except... If you would adopt the flow (from the picture) into any digital system, it will strain a LOT of unnecessary calculation from your CPU, because it will run an entire loop EVERY 10ms or so (depending on what you're checking by today's standards).
To make things easier/efficient for your processor, we would like to tell the CPU to sleep until we (we=developers/users/people) decide to check a certain value once again to take a certain action based on that value.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)
Re: Action "sleep"
Hi digitalstone
Thanks a lot. Thanks to your quick response and valuable information
Thanks a lot. Thanks to your quick response and valuable information
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1