#include <../arch/arch.h>

void V_CALL
archDelayExecution(u32_t milliseconds)
{
	/* Sleep() calls SleepEx() on NT, so call the later directly */
	SleepEx(milliseconds,FALSE);
}

/*
 * FIXME: here must be archYieldExecution()
 */

vsize_t	V_CALL
archTickCount(void)
{
	/* fixme: timeGetTime(); but _at what moment_ to call time(Begin/End)Period() ? */
	/* todo: reverse engineer time routines under NT 4.0/5.0, format of shared memory block ? */
	return GetTickCount();
}

/*

 * FIXME: this stuff can only be used by timer object, not by timeTickCount() !

#define	ARCH_TIMERS_NEEDS_BEGIN_END

#define	TIMER_RESOLUTION	1

LONG	time_begin_called_flag = -1;

 * FIXME: this isn't needed at all: the timer's resolution is fixed.
 * FIXME: this scheme doesn't prevent incorrect order of begin/end calls.

void	V_CALL
archTimerSetup(void)
{
	if(!InterlockedIncrement(&time_begin_called_flag)))
		timeBeginPeriod(TIMER_RESOLUTION);
}

void	V_CALL
archTimerCleanup(void)
{
	if(InterlockedDecrement(&time_begin_called_flag)) < 0)
		timeEndPeriod(TIMER_RESOLUTION);
}
*/

