Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sleep(3C) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                sleep(3C)



        _________________________________________________________________
        sleep                                                    function
        Delay a task for a given number of seconds.
        _________________________________________________________________


        Calling Sequence

        unsigned int hold;
        sleep(hold);

        where hold specifies the number of seconds to delay the task.


        Description

        Use the sleep function to delay a task for a specified number of
        seconds.


        Returns

        The sleep function does not return anything.


        Related Functions

        See also the pause function, described in Chapter 2 of Using
        Specialized C Functions.


        Example

        /* Program test for the sleep() function */

        unsigned int  hold;

        main() {
            printf("How long a nap (in seconds)?\n");
            scanf("%d", &hold);
            sleep(hold);
            printf("I'm awake again.\n");
        }

        If you execute the program test, and answer its query with 5, it
        pauses for 5 seconds, then generates the following:

        I'm awake again.






        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026