File:  [OS/2 SDKs] / os2sdk / demos / examples / sleep / sleep.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:26:20 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: os2sdk-1988, HEAD
Microsoft OS/2 SDK 03-01-1988

/*
 * Example of DosSleep usage
 *
 * This call suspends the execution, of the process or thread which issues
 * the call, for the specified abount of time.  Other processes and threads
 * in the system will continue to execute.
 *
 * This program sleeps for the number of milliseconds specified on the
 * command line, or 2000 if none given. It works Family API.
 *
 * Compile as: cl -AL -Lp -G0 sleep.c
 *
 * Created by Microsoft Corp. 1986
 */

#define INCL_DOSPROCESS

#include <os2def.h>
#include <bsedos.h>

main(argc, argv)
int argc;
char *argv[];
{
	ULONG TimeInterval;	  /* Number of milliseconds to delay */

	if(argc > 1)
		TimeInterval = atol(argv[1]);	/* user specified delay */
	else
		TimeInterval = 2000L;	   /* default 2 seconds */

	printf("Sleeping for %ld milliseconds.\n", TimeInterval);

	DosSleep(TimeInterval);

	printf("Sleep completed.\n");
}

unix.superglobalmegacorp.com

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