|
|
1.1 root 1: /* 1.1.1.2 ! root 2: * Example of DosSleep usage 1.1 root 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: * 1.1.1.2 ! root 13: * Created by Microsoft Corp. 1986 1.1 root 14: */ 15: 1.1.1.2 ! root 16: #define INCL_DOSPROCESS 1.1 root 17: 1.1.1.2 ! root 18: #include <os2def.h> ! 19: #include <bsedos.h> 1.1 root 20: 21: main(argc, argv) 22: int argc; 23: char *argv[]; 24: { 1.1.1.2 ! root 25: ULONG TimeInterval; /* Number of milliseconds to delay */ 1.1 root 26: 27: if(argc > 1) 28: TimeInterval = atol(argv[1]); /* user specified delay */ 29: else 1.1.1.2 ! root 30: TimeInterval = 2000L; /* default 2 seconds */ 1.1 root 31: 32: printf("Sleeping for %ld milliseconds.\n", TimeInterval); 33: 1.1.1.2 ! root 34: DosSleep(TimeInterval); 1.1 root 35: 36: printf("Sleep completed.\n"); 37: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.