/*
*      SCCS:   @(#)install/userintf/base_cputime	Rel 4.4.3 (07/20/98)
*
*	UniSoft Ltd., London, England
*/
/***********************************************************************

NAME:		base_cputime - user-modifiable use-CPU-time routines
PROJECT:	VSX (X/OPEN Validation Suite)
AUTHOR:		Geoff Clare, UniSoft Ltd.
DATE CREATED:	December 1996
MODIFICATIONS:

	Geoff Clare, October 1997
		Increase default amount of processing performed.

************************************************************************/

/*
 *	Sys_call() makes one or more calls to an interface which is
 *	known to be a system call.  I.e. after several calls the system
 *	CPU time for the process will have increased measurably.
 *	It returns 0 for success, -1 for failure.
 */

public int
sys_call()
{
	int i, ret;

	for (i = 0; i < 10; i++)
		ret = access("/", F_OK);

	return ret;
}

/*
 *	Use_time() performs processing which will accumulate
 *	user CPU time.  The number of iterations may be	adjusted
 *	if necessary.
 */

public void
use_time()
{
	int i;
	unsigned int dummy = 0;

	for (i = 0; i < 1000; i++)
		dummy = dummy + i / (dummy + 1) * (dummy % 3);
}

