Export type for specifing a time value.
The time value can be either an absolute point in time or a positive relative time offset.
TimeValue | Export type for specifing a time value. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file TimeValue. |
Types | |
struct timevalue_t | Exports timevalue_t. |
timevalue_t | The time value specifies either an aboslute time or a relative time offset. |
seconds | The seconds counted from some point in time. |
nanosec | The nano seconds counted from some point in time. |
lifetime | |
timevalue_INIT | Static initializer. |
query | |
isvalid_timevalue | Returns true if tv contains a valid value. |
diffms_timevalue | |
inline implementation | |
Macros | |
isvalid_timevalue | Implements timevalue_t.isvalid_timevalue. |
diffms_timevalue | Implements timevalue_t.diffms_timevalue. |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2011 Jörg Seebohn
Header file TimeValue.
typedef struct timevalue_t timevalue_t
Exports timevalue_t.
struct timevalue_t
The time value specifies either an aboslute time or a relative time offset. An absolute time value is normally measured in seconds since Epoch, 1970-01-01 00:00:00 +0000 (UTC). But this can differ between different clock types.
seconds | The seconds counted from some point in time. |
nanosec | The nano seconds counted from some point in time. |
lifetime | |
timevalue_INIT | Static initializer. |
query | |
isvalid_timevalue | Returns true if tv contains a valid value. |
diffms_timevalue |
Macros | |
isvalid_timevalue | Implements timevalue_t.isvalid_timevalue. |
diffms_timevalue | Implements timevalue_t.diffms_timevalue. |
Implements timevalue_t.isvalid_timevalue.
#define diffms_timevalue( endtv, starttv ) ( __extension__ ({ timevalue_t * _etv = (endtv) ; timevalue_t * _stv = (starttv) ; (_etv->seconds - _stv->seconds) * 1000 + (_etv->nanosec - _stv->nanosec) / 1000000 ; }))
Implements timevalue_t.diffms_timevalue.
Exports timevalue_t.
typedef struct timevalue_t timevalue_t
The time value specifies either an aboslute time or a relative time offset.
struct timevalue_t
The seconds counted from some point in time.
int64_t seconds
The nano seconds counted from some point in time.
int32_t nanosec
Static initializer.
#define timevalue_INIT( seconds, nano_secconds ) { seconds, nano_secconds }
Returns true if tv contains a valid value.
bool isvalid_timevalue( timevalue_t * tv )
int64_t diffms_timevalue( timevalue_t * endtv, timevalue_t * starttv )
Implements timevalue_t.diffms_timevalue.
#define diffms_timevalue( endtv, starttv ) ( __extension__ ({ timevalue_t * _etv = (endtv) ; timevalue_t * _stv = (starttv) ; (_etv->seconds - _stv->seconds) * 1000 + (_etv->nanosec - _stv->nanosec) / 1000000 ; }))