67 #define MBG_FIRST_COPYRIGHT_YEAR 2001 68 #define MBG_LAST_COPYRIGHT_YEAR 0 // use default 70 static const char *
pname =
"mbghrtime";
73 #define MAX_TS_BURST 1000 95 int32_t hns_latency = 0;
96 int this_loops =
loops;
111 if ( this_loops > 0 )
114 if ( this_loops == 0 )
155 for ( i = 0; i < this_loops; i++ )
164 for ( i = 0; i < this_loops; i++ )
172 for ( i = 0; i < this_loops; i++ )
196 printf(
"High resolution time not supported by this device.\n" );
221 "This example program reads high resolution time stamps (HR time)\n" 223 "This works only for devices which support high resolution time (HR time)." 240 int main(
int argc,
char *argv[] )
248 while ( ( c = getopt( argc, argv,
"bcn:rs:u:vh?" ) ) != -1 )
261 loops = atoi( optarg );
296 #if !MBG_PC_CYCLES_SUPPORTED 297 printf(
"** Warning: No cycles support to compute real latencies on this platform!\n" );
302 printf(
"** Falling back to raw mode.\n" );
static MBG_DEV_HANDLER_FNC do_mbghrtime
#define MBG_LAST_COPYRIGHT_YEAR
static const char * pname
Requested action completed successfully.
bool mbg_cond_err_msg(int rc, const char *what)
Check if a value is an error code and print an associated error message.
Unable to handle requested action, usage printed.
_MBG_API_ATTR int _MBG_API mbg_get_hr_time(MBG_DEV_HANDLE dh, PCPS_HR_TIME *p)
Read the card's current time with high resolution, including status.
#define mbg_rc_is_success(_rc)
MBG_CHK_SUPP_FNC mbg_chk_dev_has_hr_time
Check if a device supports the mbg_get_hr_time... functions.
#define MBG_FIRST_COPYRIGHT_YEAR
static int show_hr_timestamp(MBG_DEV_HANDLE dh)
int main(int argc, char *argv[])
PCPS_TIME_STAMP tstamp
High resolution time stamp (UTC)
Action failed for specified device.
High resolution time including status and local time offset.
static int show_hr_timestamp_burst(MBG_DEV_HANDLE dh)
A high resolution time stamp.
#define MBG_ERR_NOT_SUPP_BY_DEV
Command or feature not supported by device.
#define mbg_rc_is_error(_rc)
_MBG_API_ATTR int _MBG_API mbg_get_hr_time_comp(MBG_DEV_HANDLE dh, PCPS_HR_TIME *p, int32_t *hns_latency)
Read the current high resolution time, and compensate the call's latency.