Lely core libraries
2.3.4
|
Go to the source code of this file.
Data Structures | |
struct | io_clock_vtbl |
Typedefs | |
typedef const struct io_clock_vtbl *const | io_clock_t |
An abstract clock. | |
Functions | |
int | io_clock_getres (const io_clock_t *clock, struct timespec *res) |
Obtains the resolution of the specified clock. More... | |
int | io_clock_gettime (const io_clock_t *clock, struct timespec *tp) |
Obtains the current time value of the specified clock. More... | |
int | io_clock_settime (io_clock_t *clock, const struct timespec *tp) |
Sets the time value of the specified clock. More... | |
This header file is part of the I/O library; it contains the abstract clock interface.
The clock interface is modeled after the POSIX clock_getres(), clock_gettime() and clock_settime() functions.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file clock.h.
|
inline |
Obtains the resolution of the specified clock.
Note that the resolution MAY NOT be constant for user-defined clocks (i.e., it MAY be the interval between the last two clock updates).
clock | a pointer to a clock. |
res | the address at which to store the resolution (can be NULL). |
|
inline |
Obtains the current time value of the specified clock.
clock | a pointer to a clock. |
tp | the address at which to store the time value. |
|
inline |
Sets the time value of the specified clock.
This operation MAY require elevated privileges in the calling process.
clock | a pointer to a clock. |
tp | a pointer to the time value. This value MAY be rounded to the nearest multiple of the clock resolution given by io_clock_getres(). |