time.h

Includes:
"headerdoc.h"
<dispatch/base.h>
<stdint.h>
<mach/clock_types.h>

Introduction

Use the links in the table of contents to the left to access the documentation.



Functions

dispatch_time

Create a dispatch_time_t relative to the current value of the default or wall time clock, or modify an existing dispatch_time_t.

dispatch_walltime

Create a dispatch_time_t using the wall clock.


dispatch_time


Create a dispatch_time_t relative to the current value of the default or wall time clock, or modify an existing dispatch_time_t.

(
    macos(
        10.6),
    ios(
        4.0))  dispatch_time_t dispatch_time(
    dispatch_time_t when,
    int64_t delta);  
Parameters
when

An optional dispatch_time_t to add nanoseconds to. If DISPATCH_TIME_NOW is passed, then dispatch_time() will use the default clock (which is based on mach_absolute_time() on Apple platforms). If DISPATCH_WALLTIME_NOW is used, dispatch_time() will use the value returned by gettimeofday(3). dispatch_time(DISPATCH_WALLTIME_NOW, delta) is equivalent to dispatch_walltime(NULL, delta).

delta

Nanoseconds to add.

Return Value

A new dispatch_time_t.

Discussion

On Apple platforms, the default clock is based on mach_absolute_time().


dispatch_walltime


Create a dispatch_time_t using the wall clock.

(
    macos(
        10.6),
    ios(
        4.0))  dispatch_time_t dispatch_walltime(
    const struct timespec *_Nullable when,
    int64_t delta);  
Parameters
when

A struct timespec to add time to. If NULL is passed, then dispatch_walltime() will use the result of gettimeofday(3). dispatch_walltime(NULL, delta) returns the same value as dispatch_time(DISPATCH_WALLTIME_NOW, delta).

delta

Nanoseconds to add.

Return Value

A new dispatch_time_t.

Discussion

On Mac OS X the wall clock is based on gettimeofday(3).


Typedefs

dispatch_time_t

A somewhat abstract representation of time; where zero means "now" and DISPATCH_TIME_FOREVER means "infinity" and every value in between is an opaque encoding.


dispatch_time_t


A somewhat abstract representation of time; where zero means "now" and DISPATCH_TIME_FOREVER means "infinity" and every value in between is an opaque encoding.

typedef uint64_t dispatch_time_t;