Source

replaceables / Win16bit / _SleepX.C

/* This is a replaceable C file for the non-ANSI methods of suspending a
system for a number of seconds or milliseconds, this version is for Windows
3.x */

#include <Windows.H>
#pragma hdrstop

#include "Replace\Win16bit\_Sleepx.H" /* Our header */
/*-------------------------------------------------------------------------*/
void SleepSecs(unsigned Secs)
{
	  /* Windows 3.1 did not have a Sleep() function as it does today, we
	  must do the job ourselves based on he GetTickCount() function */

	  DWORD stopTime = GetTickCount() + (DWORD)Secs * (DWORD)1000;

	  while (GetTickCount() < stopTime) /* Not time to stop yet? */
	  {}
}
/*-------------------------------------------------------------------------*/
void SleepMS(unsigned ms)
{
	  /* Windows 3.1 did not have a Sleep() function as it does today, we
	  must do the job ourselves based on he GetTickCount() function */

	  DWORD stopTime = GetTickCount() + (DWORD)ms;

	  while (GetTickCount() < stopTime) /* Not time to stop yet? */
	  {}
}
/*-------------------------------------------------------------------------*/