kusano 7d535a
/* 
kusano 7d535a
 * Purpose
kusano 7d535a
 * ======= 
kusano 7d535a
 *	Returns the time in seconds used by the process.
kusano 7d535a
 *
kusano 7d535a
 * Note: the timer function call is machine dependent. Use conditional
kusano 7d535a
 *       compilation to choose the appropriate function.
kusano 7d535a
 *
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
kusano 7d535a
#ifdef SUN 
kusano 7d535a
/*
kusano 7d535a
 * 	It uses the system call gethrtime(3C), which is accurate to 
kusano 7d535a
 *	nanoseconds. 
kusano 7d535a
*/
kusano 7d535a
#include <sys time.h=""></sys>
kusano 7d535a
 
kusano 7d535a
double SuperLU_timer_() {
kusano 7d535a
    return ( (double)gethrtime() / 1e9 );
kusano 7d535a
}
kusano 7d535a
kusano 7d535a
#else
kusano 7d535a
kusano 7d535a
#include <sys types.h=""></sys>
kusano 7d535a
#include <sys times.h=""></sys>
kusano 7d535a
#include <time.h></time.h>
kusano 7d535a
#include <sys time.h=""></sys>
kusano 7d535a
kusano 7d535a
#ifndef CLK_TCK
kusano 7d535a
#define CLK_TCK 60
kusano 7d535a
#endif
kusano 7d535a
kusano 7d535a
double SuperLU_timer_()
kusano 7d535a
{
kusano 7d535a
    struct tms use;
kusano 7d535a
    double tmp;
kusano 7d535a
    times(&use);
kusano 7d535a
    tmp = use.tms_utime;
kusano 7d535a
    tmp += use.tms_stime;
kusano 7d535a
    return (double)(tmp) / CLK_TCK;
kusano 7d535a
}
kusano 7d535a
kusano 7d535a
#endif
kusano 7d535a