Function amqp_get_monotonic_timestamp

Synopsis

#include <librabbitmq/amqp_time.h>

uint64_t amqp_get_monotonic_timestamp(void)

Description

No description yet.

Source

Lines 90-101 in librabbitmq/amqp_time.c. Line 61 in librabbitmq/amqp_time.h.

uint64_t amqp_get_monotonic_timestamp(void) {
#ifdef __hpux
  return (uint64_t)gethrtime();
#else
  struct timespec tp;
  if (-1 == clock_gettime(CLOCK_MONOTONIC, &tp)) {
    return 0;
  }

  return ((uint64_t)tp.tv_sec * AMQP_NS_PER_S + (uint64_t)tp.tv_nsec);
#endif
}





Add Discussion as Guest

Log in to DocsForge