1DTK_GETTIME(3) Draw Toolkit manual DTK_GETTIME(3)
2
3
4
6 dtk_gettime - high resolution timestamp
7
9 #include <dtk_time.h>
10
11 void dtk_gettime(struct dtk_timespec* ts);
12
14 The function dtk_gettime() retrieves the time of a high precision
15 clock. The time is returned in the ts argument which is a pointer to a
16 dtk_timespec structure defined as:
17
18 struct dtk_timespec {
19 long sec; /* seconds */
20 long nsec; /* nanoseconds */
21 };
22
23 The time represents seconds and nanoseconds since the Epoch, 1970-01-01
24 00:00:00 +0000 (UTC).
25
27 None
28
30 This function is wrapper to clock_gettime(2) if it is provided by the
31 system. Otherwise, it implements the function by using the timer with
32 the highest precision available on the system.
33
35 dtk_nanosleep(3), clock_gettime(2)
36
37
38
39EPFL 2011 DTK_GETTIME(3)