---
name: "ttime"
section: "3"
platform: "linux"
package: "lam2-dev"
version: "6.3.2-3"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ttime"
---

# ttime(3)

Get LAM timer value in seconds.

## 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.
