This HTML automatically generated with rman for NEMO
Table of Contents

Name

cputime, etime, dtime - routines to time your code

Synopsis


#include <stdinc.h>double cputime(void);double cputime2(int mode)float etime(float
*tarray);float dtime(float *tarray);

Description

cputime returns the CPU time in minutes. cputime2 allows a mode to be passed, which time is requested. mode=0,1: user and sys time from times(2) , and mode=2 from clock(2) .

Two old FORTRAN routines, etime and dtime can be compiled into this code, if not available on the local system (-DETIME):

etime returns the elapsed runtime in seconds for the calling process.

dtime returns the elapsed time since the last call to dtime, or the start of execution on the first call. The returned argument tarray contains user time in the first element and system time in the second element. Elapsed time, the returned value, is the sum of user and system time.

See Also

timers(3NEMO) , times(2) , clock(2)

Author

Peter Teuben

Files


~/src/kernel/cores    cputime.c

Update History


28-aug-2012    finally documented    PJT
11-jul-2020    added cputime2(mode)    PJT


Table of Contents