ttime(3) - Linux man page

Name

ttime - Get LAM timer value in seconds.

C Synopsis

#include <net.h>
double ttime ();

Fortran Synopsis

double precision FTTIME()

Description

The ttime() function enables a program running on any LAM node to read the current value of the system timer in a portable fashion. This is useful for measuring execution times of program sections. ttime() returns the timer value in seconds as a double precision floating point number.

Example

#include <stdio.h>
#include <net.h>
double    time, start, end;
start = ttime();
my_sub();
end = ttime();
time = end - start;
printf("my_sub took: %f seconds to execute\n", time);

Bugs

The resolution of the measurements is bound by that of the underlying system timer used.