22 #ifndef _CMP_TIME_UTIL_H 23 #define _CMP_TIME_UTIL_H 41 #if 0 && defined( _USE_PACK ) // use default alignment 42 #pragma pack( 1 ) // set byte alignment 43 #define _USING_BYTE_ALIGNMENT 53 #if defined( MBG_TGT_WIN32 ) 54 #define snprintf _snprintf 145 #if defined( _USING_BYTE_ALIGNMENT ) 146 #pragma pack() // set default alignment 147 #undef _USING_BYTE_ALIGNMENT
int mbg_snprint_hr_time_loc(char *s, size_t max_len, const PCPS_HR_TIME *p)
Print local date and time from a PCPS_TIME_STAMP structure to a string.
MBG_PC_CYCLES_FREQUENCY cyc_freq
Must be set up tby the application.
int get_htc_timestamps(MBG_DEV_HANDLE dh1, PCPS_HR_TIME_CYCLES *p_htc1, MBG_DEV_HANDLE dh2, PCPS_HR_TIME_CYCLES *p_htc2, int read_fast)
Read timestamps and cycles from both devices.
int mbg_snprint_hr_tstamp_ext(char *s, int max_len, const PCPS_TIME_STAMP *p, int print_raw)
Print UTC date and time from a PCPS_TIME_STAMP structure to a string.
uint64_t MBG_PC_CYCLES_FREQUENCY
High resolution time including status and local time offset.
High resolution time plus associated system cycles count.
A high resolution time stamp.
double get_htc_delta(const PCPS_HR_TIME_CYCLES *p_htc, const PCPS_HR_TIME_CYCLES *p_htc_ref, double *p_delta_ts, double *p_delta_cyc)
Compute the delta cycles and time difference.
int MBG_ERR_MSG_FNC(const PCPS_DEV *p_dev, const char *s)
int chk_fast_tstamp_supp(MBG_DEV_HANDLE dh1, const PCPS_DEV *p_dev_1, MBG_DEV_HANDLE dh2, const PCPS_DEV *p_dev_2, MBG_ERR_MSG_FNC err_msg_fnc)
Check if both devices support fast HR timestamps.