# The Time interface

A `Time.T` represents a moment in time, reckoned as a number of seconds since some epoch or starting point. time of day

time Time interface <TT>Time</TT> interface

    INTERFACE Time;

    TYPE T = LONGREAL;

    PROCEDURE Now(): T;

Return the current moment in time.

    VAR (*CONST*) Grain: LONGREAL;

If a thread performs `t0 := Time.Now(); t1 := Time.Now()`, then either `t1 = t0` or `t1 >= t0 + Time.Grain`. `Grain` always lies in the half-open interval `(0..1]` and is usually no larger than one sixtieth of a second.

    END Time.

There are a variety of timekeeping needs, and `Time.Now` may not satisfy all of them. It is intended to be useful for recording times and measuring intervals arising during the execution of computer programs with a resolution comparable to human reaction times.

The epoch for a `Time.T` varies from one operating system to another. To determine the epoch, call `Date.FromTime(0.0D0, Date.UTC)`. Note that communicating a `Time.T` between systems, say via remote procedure call or pickles, is likely to be a bad idea. epoch

In many computers, `Time.Now` is implemented with the technology of an inexpensive wristwatch, and is therefore likely to suffer from similar errors: the rate may vary, and the value may be changed by a human operator.

The `Thread` interface contains procedures that delay the execution of the calling thread for a specified duration. The `Tick` interface provides access to a clock with subsecond resolution.