Annotation of os2sdk/demos/examples/sleep/sleep.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Example of DOSSLEEP usage
        !             3:  *
        !             4:  * This call suspends the execution, of the process or thread which issues
        !             5:  * the call, for the specified abount of time.  Other processes and threads
        !             6:  * in the system will continue to execute.
        !             7:  *
        !             8:  * This program sleeps for the number of milliseconds specified on the
        !             9:  * command line, or 2000 if none given. It works Family API.
        !            10:  *
        !            11:  * Compile as: cl -AL -Lp -G0 sleep.c
        !            12:  *
        !            13:  * Copyright (C) Microsoft Corp. 1986
        !            14:  */
        !            15: 
        !            16: #include  <doscalls.h>
        !            17: 
        !            18: extern long atol();
        !            19: 
        !            20: main(argc, argv)
        !            21: int argc;
        !            22: char *argv[];
        !            23: {
        !            24:        unsigned long TimeInterval;       /* Number of milliseconds to delay */
        !            25: 
        !            26:        if(argc > 1)
        !            27:                TimeInterval = atol(argv[1]);   /* user specified delay */
        !            28:        else
        !            29:                TimeInterval = (long)2000;      /* default 2 seconds */
        !            30: 
        !            31:        printf("Sleeping for %ld milliseconds.\n", TimeInterval);
        !            32: 
        !            33:        DOSSLEEP(TimeInterval);
        !            34: 
        !            35:        printf("Sleep completed.\n");
        !            36: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.