libxnvme_util.h#

Structs#

xnvme_timer#

struct xnvme_timer#

Encapsulation of a basic wall-clock timer, start/stop clock.

Public Members

uint64_t start#
uint64_t stop#

Functions#

xnvme_is_pow2#

static inline int xnvme_is_pow2(uint32_t val)#

xnvme_timer_bw_pr#

static inline void xnvme_timer_bw_pr(struct xnvme_timer *t, const char *prefix, size_t nbytes)#

Print the elapsed time in seconds and the associated data rate in MB/s.

Parameters:
  • t

  • prefix

  • nbytes

xnvme_timer_elapsed#

static inline double xnvme_timer_elapsed(struct xnvme_timer *t)#

Get the elapsed time in seconds.

Parameters:
  • t

Returns:

elapsed time in seconds as a floating point number

xnvme_timer_elapsed_msecs#

static inline double xnvme_timer_elapsed_msecs(struct xnvme_timer *t)#

Get the elapsed time in milliseconds.

Parameters:
  • t

Returns:

elapsed time in milliseconds as a floating point number

xnvme_timer_elapsed_nsecs#

static inline uint64_t xnvme_timer_elapsed_nsecs(struct xnvme_timer *t)#

Get the elapsed time in nanoseconds.

Parameters:
  • t

Returns:

elapsed time in nanoseconds

xnvme_timer_elapsed_secs#

static inline double xnvme_timer_elapsed_secs(struct xnvme_timer *t)#

Get the elapsed time in seconds.

Parameters:
  • t

Returns:

elapsed time in seconds as a floating point number

xnvme_timer_elapsed_usecs#

static inline double xnvme_timer_elapsed_usecs(struct xnvme_timer *t)#

Get the elapsed time in microseconds.

Parameters:
  • t

Returns:

elapsed time in microseconds as a floating point number

xnvme_timer_pr#

static inline void xnvme_timer_pr(struct xnvme_timer *t, const char *prefix)#

Print the elapsed time in seconds as a floating point number.

Parameters:
  • t

  • prefix

xnvme_timer_start#

static inline uint64_t xnvme_timer_start(struct xnvme_timer *t)#

Start the given timer.

Parameters:
  • t

Returns:

clock sample in nano seconds

xnvme_timer_stop#

static inline uint64_t xnvme_timer_stop(struct xnvme_timer *t)#

Stop the given timer.

Parameters:
  • t

Returns:

clock sample in nano seconds