# `./fio-stl/004 time.h`

17 public symbols.

### Functions

#### `fio_time_real`

```c
inline struct timespec fio_time_real(void)
```

Returns human (watch) time... this value isn't as safe for measurements.

_Symbol type:_ `function`

#### `fio_time_mono`

```c
inline struct timespec fio_time_mono(void)
```

Returns monotonic time.

_Symbol type:_ `function`

#### `fio_time_nano`

```c
inline int64_t fio_time_nano(void)
```

Returns monotonic time in nano-seconds (now in 1 billionth of a second).

_Symbol type:_ `function`

#### `fio_time_micro`

```c
inline int64_t fio_time_micro(void)
```

Returns monotonic time in micro-seconds (now in 1 millionth of a second).

_Symbol type:_ `function`

#### `fio_time_milli`

```c
inline int64_t fio_time_milli(void)
```

Returns monotonic time in milliseconds.

_Symbol type:_ `function`

#### `fio_time2milli`

```c
inline int64_t fio_time2milli(struct timespec)
```

Converts a `struct timespec` to milliseconds.

_Symbol type:_ `function`

#### `fio_time2micro`

```c
inline int64_t fio_time2micro(struct timespec)
```

Converts a `struct timespec` to microseconds.

_Symbol type:_ `function`

#### `fio_time2gm`

```c
struct tm fio_time2gm(time_t time)
```

A faster (yet less localized) alternative to `gmtime_r`.

See the libc `gmtime_r` documentation for details.

Falls back to `gmtime_r` for dates before epoch.

_Symbol type:_ `function`

#### `fio_gm2time`

```c
time_t fio_gm2time(struct tm tm)
```

Converts a `struct tm` to time in seconds (assuming UTC).

_Symbol type:_ `function`

#### `fio_time2rfc7231`

```c
size_t fio_time2rfc7231(char *target, time_t time)
```

Writes an RFC 7231 date representation (HTTP date format) to target.

Usually requires 29 characters, although this may vary.

_Symbol type:_ `function`

#### `fio_time2rfc2109`

```c
size_t fio_time2rfc2109(char *target, time_t time)
```

Writes an RFC 2109 date representation to target (HTTP Cookie Format).

Usually requires 31 characters, although this may vary.

_Symbol type:_ `function`

#### `fio_time2rfc2822`

```c
size_t fio_time2rfc2822(char *target, time_t time)
```

Writes an RFC 2822 date representation to target (Internet Message Format).

Usually requires 28 to 29 characters, although this may vary.

_Symbol type:_ `function`

#### `fio_time2log`

```c
size_t fio_time2log(char *target, time_t time)
```

Writes a date representation to target in common log format. i.e.,

        [DD/MMM/yyyy:hh:mm:ss +0000]

Usually requires 29 characters (including square brackets and NUL).

_Symbol type:_ `function`

#### `fio_time2iso`

```c
size_t fio_time2iso(char *target, time_t time)
```

Writes a date representation to target in ISO 8601 format. i.e.,

        YYYY-MM-DD HH:MM:SS

Usually requires 20 characters (including NUL).

_Symbol type:_ `function`

#### `fio_time_add`

```c
inline struct timespec fio_time_add(struct timespec t, struct timespec t2)
```

Adds two `struct timespec` objects.

_Symbol type:_ `function`

#### `fio_time_add_milli`

```c
inline struct timespec fio_time_add_milli(struct timespec t, int64_t milli)
```

Adds milliseconds to a `struct timespec` object.

_Symbol type:_ `function`

#### `fio_time_cmp`

```c
inline int fio_time_cmp(struct timespec t1, struct timespec t2)
```

Compares two `struct timespec` objects.

_Symbol type:_ `function`

-----------------------------------------------------
