A time object has type, seconds and nanoseconds fields representing a point in time starting from some epoch. This is an arbitrary point in time, not just a time of day. Although times are represented in nanoseconds, the actual resolution may be lower.

The following variables hold the possible time types. For instance
`(current-time time-process)`

would give the current CPU process
time.

— Variable: **time-monotonic**

Monotonic time, meaning a monotonically increasing time starting from an unspecified epoch.

Note that in the current implementation

`time-monotonic`

is the same as`time-tai`

, and unfortunately is therefore affected by adjustments to the system clock. Perhaps this will change in the future.

— Variable: **time-process**

CPU time spent in the current process, starting from when the process began.

— Function: **make-time**` type nanoseconds seconds`

Create a time object with the given

type,secondsandnanoseconds.

— Function: **time-type**` time`

— Function:**time-nanosecond**` time`

— Function:**time-second**` time`

— Function:**set-time-type!**` time type`

— Function:**set-time-nanosecond!**` time nsec`

— Function:**set-time-second!**` time sec`

— Function:

— Function:

— Function:

— Function:

— Function:

Get or set the type, seconds or nanoseconds fields of a time object.

`set-time-type!`

merely changes the field, it doesn't convert the time value. For conversions, see SRFI-19 Time/Date conversions.

— Function: **current-time** [`type`]

Return the current time of the given

type. The defaulttypeis`time-utc`

.Note that the name

`current-time`

conflicts with the Guile core`current-time`

function (see Time). Applications wanting to use both will need to use a different name for one of them.

— Function: **time-resolution** [`type`]

Return the resolution, in nanoseconds, of the given time

type. The defaulttypeis`time-utc`

.

— Function: **time<=?**` t1 t2`

— Function:**time<?**` t1 t2`

— Function:**time=?**` t1 t2`

— Function:**time>=?**` t1 t2`

— Function:**time>?**` t1 t2`

— Function:

— Function:

— Function:

— Function:

Return

`#t`

or`#f`

according to the respective relation between time objectst1andt2.t1andt2must be the same time type.

— Function: **time-difference**` t1 t2`

— Function:**time-difference!**` t1 t2`

— Function:

Return a time object of type

`time-duration`

representing the period betweent1andt2.t1andt2must be the same time type.

`time-difference`

returns a new time object,`time-difference!`

may modifyt1to form its return.

— Function: **add-duration**` time duration`

— Function:**add-duration!**` time duration`

— Function:**subtract-duration**` time duration`

— Function:**subtract-duration!**` time duration`

— Function:

— Function:

— Function:

Return a time object which is

timewith the givendurationadded or subtracted.durationmust be a time object of type`time-duration`

.

`add-duration`

and`subtract-duration`

return a new time object.`add-duration!`

and`subtract-duration!`

may modify the giventimeto form their return.