double app_tminterval(int stop,int usertime)
	{
	double		ret = 0;
	struct rusage	rus;
	struct timeval	now;
	static struct timeval tmstart;

	if (usertime)		getrusage(RUSAGE_SELF,&rus), now = rus.ru_utime;
	else			gettimeofday(&now,NULL);

	if (stop==TM_START)	tmstart = now;
	else			ret = ( (now.tv_sec+now.tv_usec*1e-6)
					- (tmstart.tv_sec+tmstart.tv_usec*1e-6) );

	return ret;
	}
double app_tminterval(int stop,int usertime)
	{
	double		ret = 0;
	struct rusage	rus;
	struct timeval	now;
	static struct timeval tmstart;

	if (usertime)		getrusage(RUSAGE_SELF,&rus), now = rus.ru_utime;
	else			gettimeofday(&now,NULL);

	if (stop==TM_START)	tmstart = now;
	else			ret = ( (now.tv_sec+now.tv_usec*1e-6)
					- (tmstart.tv_sec+tmstart.tv_usec*1e-6) );

	return ret;
	}