Structure of a time value in a convenient format.
More...
#include <timeVal.h>
Structure of a time value in a convenient format.
TimeVal::TimeVal |
( |
int |
sec, |
|
|
int |
mcsec |
|
) |
| |
Constructor.
Parameters represent time in the format - (sec * 10^6 + mcsec) mcsec. Constructor translates this value to the new format - 1 unit of a new value(mTime) is equal to 256 mcsec. Note that after these conversions value in microseconds becomes rounded, but we can neglect this fact in most cases. Formula for translation : mTime = (sec * 10^6 + mcsec) << 8 = sec * 10^6 << mShift + mcsec << mShift = = sec * mSecConst << (mShift - 6) + mcsec << mShift
TimeVal TimeVal::fromPackedUInt32 |
( |
uint32_t |
packedTime | ) |
|
|
static |
Creates TimeVal using packed data.
It needs for hiding one argument constructor of TimeVal from packed data.
uint32_t TimeVal::packedUInt32 |
( |
| ) |
const |
Returns packed data that shifted to the left on mShift bits.
int TimeVal::timeInterval |
( |
int |
packedTimeLeft, |
|
|
int |
packedTimeRight |
|
) |
| |
|
static |
Counts time interval between two packed data of time.
"Minus" operator is for computing time interval between two timestamps, returns value in microsends.
- Parameters
-
left | - a value before sign, usually "time after event". |
right | - a value after sign, usually "time before event". |
void* qMetaTypeConstructHelper |
( |
const TimeVal * |
t | ) |
|
|
friend |
This method is used in qRegisterMetaType() method and needs default constructor.
It is a friend method for hiding default constructor.
The documentation for this class was generated from the following files: