GNU/Linux |
RedHat 6.2(Zoot) |
|
![]() |
ttime(3) |
![]() |
ttime − Get LAM timer value in seconds.
#include <net.h>
double ttime ();
double precision FTTIME()
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.
#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);
The resolution of the measurements is bound by that of the underlying system timer used.
![]() |
ttime(3) | ![]() |