summaryrefslogtreecommitdiff
path: root/doc/usage/cmd/sleep.rst
blob: d19e5b3af8727efd5b332e3285a76009ee216a3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.. SPDX-License-Identifier: GPL-2.0+
.. Copyright 2023, Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

sleep command
=============

Synopsis
--------

::

    sleep <delay>

Description
-----------

The *sleep* command waits for *delay* seconds. It can be interrupted by
CTRL+C.

delay
   delay in seconds. The value is decimal and can be fractional.

Example
-------

The current data and time is display before and after sleeping for 3.2
seconds:

::

    => date; sleep 3.2; date
    Date: 2023-01-21 (Saturday)    Time: 16:02:41
    Date: 2023-01-21 (Saturday)    Time: 16:02:44
    =>

Configuration
-------------

The command is only available if CONFIG_CMD_SLEEP=y.

Return value
------------

The return value $? is 0 (true) if the command completes.
The return value is 1 (false) if the command is interrupted by CTRL+C.