Heinrich Schuchardt | ff8a482 | 2023-01-21 16:24:03 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. Copyright 2023, Heinrich Schuchardt <heinrich.schuchardt@canonical.com> |
| 3 | |
Heinrich Schuchardt | 1b0c316 | 2024-01-14 14:53:13 +0100 | [diff] [blame] | 4 | .. index:: |
| 5 | single: sleep (command) |
| 6 | |
Heinrich Schuchardt | ff8a482 | 2023-01-21 16:24:03 +0100 | [diff] [blame] | 7 | sleep command |
| 8 | ============= |
| 9 | |
| 10 | Synopsis |
| 11 | -------- |
| 12 | |
| 13 | :: |
| 14 | |
| 15 | sleep <delay> |
| 16 | |
| 17 | Description |
| 18 | ----------- |
| 19 | |
| 20 | The *sleep* command waits for *delay* seconds. It can be interrupted by |
| 21 | CTRL+C. |
| 22 | |
| 23 | delay |
| 24 | delay in seconds. The value is decimal and can be fractional. |
| 25 | |
| 26 | Example |
| 27 | ------- |
| 28 | |
| 29 | The current data and time is display before and after sleeping for 3.2 |
| 30 | seconds: |
| 31 | |
| 32 | :: |
| 33 | |
| 34 | => date; sleep 3.2; date |
| 35 | Date: 2023-01-21 (Saturday) Time: 16:02:41 |
| 36 | Date: 2023-01-21 (Saturday) Time: 16:02:44 |
| 37 | => |
| 38 | |
| 39 | Configuration |
| 40 | ------------- |
| 41 | |
| 42 | The command is only available if CONFIG_CMD_SLEEP=y. |
| 43 | |
| 44 | Return value |
| 45 | ------------ |
| 46 | |
| 47 | The return value $? is 0 (true) if the command completes. |
| 48 | The return value is 1 (false) if the command is interrupted by CTRL+C. |