double app_tminterval(int stop,int usertime)
	{
	FILETIME		now;
	double			ret=0;
	static ULARGE_INTEGER	tmstart;
	static int		warning=1;
#ifdef _WIN32_WINNT
	static HANDLE		proc=NULL;

	if (proc==NULL)
		{
		if (GetVersion() < 0x80000000)
			proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE,
						GetCurrentProcessId());
		if (proc==NULL) proc = (HANDLE)-1;
		}

	if (usertime && proc!=(HANDLE)-1)
		{
		FILETIME junk;
		GetProcessTimes(proc,&junk,&junk,&junk,&now);
		}
	else
#endif
		{
		SYSTEMTIME systime;

		if (usertime && warning)
			{
			BIO_printf(bio_err,"To get meaningful results, run "
					   "this program on idle system.\n");
			warning=0;
			}
		GetSystemTime(&systime);
		SystemTimeToFileTime(&systime,&now);
		}

	if (stop==TM_START)
		{
		tmstart.u.LowPart  = now.dwLowDateTime;
		tmstart.u.HighPart = now.dwHighDateTime;
		}
	else	{
		ULARGE_INTEGER tmstop;

		tmstop.u.LowPart   = now.dwLowDateTime;
		tmstop.u.HighPart  = now.dwHighDateTime;

		ret = (__int64)(tmstop.QuadPart - tmstart.QuadPart)*1e-7;
		}

	return (ret);
	}
double app_tminterval(int stop,int usertime)
	{
	FILETIME		now;
	double			ret=0;
	static ULARGE_INTEGER	tmstart;
	static int		warning=1;
#ifdef _WIN32_WINNT
	static HANDLE		proc=NULL;

	if (proc==NULL)
		{
		if (GetVersion() < 0x80000000)
			proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE,
						GetCurrentProcessId());
		if (proc==NULL) proc = (HANDLE)-1;
		}

	if (usertime && proc!=(HANDLE)-1)
		{
		FILETIME junk;
		GetProcessTimes(proc,&junk,&junk,&junk,&now);
		}
	else
#endif
		{
		SYSTEMTIME systime;

		if (usertime && warning)
			{
			BIO_printf(bio_err,"To get meaningful results, run "
					   "this program on idle system.\n");
			warning=0;
			}
		GetSystemTime(&systime);
		SystemTimeToFileTime(&systime,&now);
		}

	if (stop==TM_START)
		{
		tmstart.u.LowPart  = now.dwLowDateTime;
		tmstart.u.HighPart = now.dwHighDateTime;
		}
	else	{
		ULARGE_INTEGER tmstop;

		tmstop.u.LowPart   = now.dwLowDateTime;
		tmstop.u.HighPart  = now.dwHighDateTime;

		ret = (__int64)(tmstop.QuadPart - tmstart.QuadPart)*1e-7;
		}

	return (ret);
	}