Sleep
Summary
- Internal name:
Sleep - Category: Time
- Purpose: Pause the workflow execution for a specified duration.
- Task type: Normal
Compatibility
- Minimum AndroMate version:
1.1.0 - Maximum AndroMate version:
1.1.0 - Minimum Android version:
Android 13 (API 33) -
Maximum Android version tested:
Android 16 (API 36) -
Supported manufacturers:
-
✅ All manufacturers (tested on Samsung One UI 6.x / 7.x / 8.x and Google Pixel Android Stock)
-
Required permissions:
- None
Detailed description
The Sleep task temporarily pauses the workflow execution. It is used to:
- Add delays between two automated actions.
- Wait for a screen to stabilize before performing the next action (click, swipe...).
- Synchronize network or system actions (e.g., wait for SIM, Wi-Fi, or network state change).
- Create controlled pauses in benchmarking, QoS, or TV scenarios.
Known limitations
- Very long durations may unnecessarily extend the total workflow execution time.
- Does not guarantee that the system state is stable when the pause ends; it is only a fixed delay.
Input parameters
| Parameter | Type | Required | Possible values | Android Compatibility | AndroMate Compatibility | Default |
|---|---|---|---|---|---|---|
Time_sleep |
Long | Yes | >= 0 (milliseconds) | Android 13 (API 33) → Android 16 (API 36) | 1.1.0 → 1.1.0 | 0 |
Output parameters
This task produces no output. It returns VoidResult.
Exceptions
This task does not throw any exceptions.
Execution flowchart
flowchart TD
Start([▶ Sleep]) --> ReadParam[🔄 Read Time_sleep\nfrom JSON config]
ReadParam --> DoSleep[⏸️ deepSleep\nTime_sleep ms]
DoSleep --> Success([✅ VoidResult])
style Start fill:#e3f2fd
style Success fill:#c8e6c9
style DoSleep fill:#f3e5f5
style ReadParam fill:#fff9c4
How it works:
- Read parameter:
Time_sleepis read from the JSON configuration (default0) - Execute sleep: The thread is paused for the specified duration using
ThreadHelper.deepSleep() - Result: Returns
VoidResult— no output, no exceptions
Input parameter details
1. Input parameter: Time_sleep
Duration of the pause in milliseconds.
Example
Details
- Type: Long
- Default:
0 - Value
0means no pause. - Very long values extend total workflow execution time without benefit.
- Recommended values: 500–30000 ms depending on use case.