## manifold.time

This namespace contains methods for converting units of time, with milliseconds as the base representation, and for deferring execution of functions to some time in the future. In practice, the methods here are not necessary to use Manifold effectively - `manifold.deferred/timeout`

and `manifold.stream/periodically`

are more directly useful - but they are available for anyone who should need them.

### add

`(add timestamp value unit)`

Takes a `timestamp`

, and adds `value`

multiples of `unit`

to the value.

### at

`(at timestamp f)`

Schedules no-arg function `f`

to be invoked at `timestamp`

, which is the milliseconds since the epoch. Returns a deferred representing the returned value of the function.

### every

`(every period f)`

`(every period initial-delay f)`

Schedules no-arg function `f`

to be invoked every `period`

milliseconds, after `initial-delay`

milliseconds, which defaults to `0`

. Returns a zero-argument function which, when invoked, cancels the repeated invocation.

If the invocation of `f`

ever throws an exception, repeated invocation is automatically cancelled.

### floor

`(floor timestamp unit)`

Takes a `timestamp`

, and rounds it down to the nearest even multiple of the `unit`

.

(floor 1001 :second) => 1000 (floor (seconds 61) :minute) => 60000

### format-duration

`(format-duration n)`

Takes a duration in milliseconds, and returns a formatted string describing the interval, i.e. ‘5d 3h 1m’

### in

`(in interval f)`

Schedules no-arg function `f`

to be invoked in `interval`

milliseconds. Returns a deferred representing the returned value of the function.