Source

replaceables / Win32s / _SleepX.C

Full commit
/* 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 Win32s

Revision : 1

Revision history: 1 - Added support for not calling Win32's Sleep() if
the sleep time is zero, because Sleep(0) means give up remainder of
timeslice in Win32 and that isn't what we want, that would slow program
execution if it happened enough */

#include <Windows.H>
#pragma hdrstop

#include "Replace\Win32s\_Sleepx.H" /* Our header */
/*-------------------------------------------------------------------------*/
void SleepSecs(unsigned Secs)
{
  if (Secs)
    Sleep(Secs * 1000); /* Sleep() takes milliseconds, so convert */
}
/*-------------------------------------------------------------------------*/
void SleepMS(unsigned ms)
{
  if (ms)
    Sleep(ms); /* Use Windows 32-bit Sleep() function */
}
/*-------------------------------------------------------------------------*/