dtk_gettime(3)

dtk_gettime3

High resolution timestamp

Usage

#include <dtk_time.h>

void dtk_gettime(struct dtk_timespec* ts);

Overview

The function dtk_gettime() retrieves the time of a high precision clock. The time is returned in the ts argument which is a pointer to a dtk_timespec structure defined as:

struct dtk_timespec {
    long sec;    /* seconds */
    long nsec;   /* nanoseconds */
};

The time represents seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).

Return value

None

Note

This function is wrapper to clock_gettime(2) if it is provided by the system. Otherwise, it implements the function by using the timer with the highest precision available on the system.

Releases

Unchanged in 2 releases since Debian 7 (Wheezy).

  1. 7–8

From libdrawtk-dev 2.0-2.1 in Debian 8 (Jessie). Parsed by carta from the page's man source.