Files
mercury/runtime/mercury_timing.c
Tyson Dowd bd19208eb9 Remove old .h files.
Estimated hours taken: 1

runtime/*.h:
runtime/*.c:
runtime/mercury_conf.h.in:
	Remove old .h files.
	Update #includes to refer to mercury_*.h
	Update #ifdef MODULE_H to be #ifdef MERCURY_MODULE_H
1997-11-23 07:21:53 +00:00

35 lines
684 B
C

/*
** Copyright (C) 1993-1994, 1997 The University of Melbourne.
** This file may only be copied under the terms of the GNU Library General
** Public License - see the file COPYING.LIB in the Mercury distribution.
*/
/*
** file: timing.c
** main authors: fjh
**
** Timing routines.
*/
#include "mercury_imp.h"
#include <sys/times.h> /* for times() and `struct tms' */
#include "mercury_timing.h"
int
MR_get_user_cpu_miliseconds(void)
{
#ifndef MR_CLOCK_TICKS_PER_SECOND
return -1;
#else
const double ticks_per_milisecond = MR_CLOCK_TICKS_PER_SECOND / 1000.0;
struct tms t;
if (times(&t) == -1) {
return -1;
}
return (int) (t.tms_utime / ticks_per_milisecond);
#endif
}