#ifndef VXWORKS_CFG
#include <sys/time.h>
#include <sys/resource.h>

double cputime()
{
 static struct rusage ru;

 getrusage(RUSAGE_SELF,&ru);
 return(ru.ru_utime.tv_sec+(ru.ru_utime.tv_usec/1000000.));
}

int int_cputime()
{
 static struct rusage ru;

 getrusage(RUSAGE_SELF,&ru);
 return((ru.ru_utime.tv_sec*1000000)+ru.ru_utime.tv_usec);
}

#else
double cputime()
{
	return (tickGet()/(double)sysClkRateGet());
}

int int_cputime()
{
	return (tickGet()/sysClkRateGet());
}
#endif
