Sha256: 805110c40830bfb03a17ea017323450fdf56ece809ec954bc3618e9a151e97f7

Contents?: true

Size: 904 Bytes

Versions: 12

Compression:

Stored size: 904 Bytes

Contents

#pragma once

#include <stdbool.h>

#define SECONDS_AS_NS(value) (value * 1000 * 1000 * 1000L)
#define MILLIS_AS_NS(value) (value * 1000 * 1000L)

#define RAISE_ON_FAILURE true
#define DO_NOT_RAISE_ON_FAILURE false

#define INVALID_TIME -1

typedef struct {
  long system_epoch_ns_reference;
  long delta_to_epoch_ns;
} monotonic_to_system_epoch_state;

#define MONOTONIC_TO_SYSTEM_EPOCH_INITIALIZER {.system_epoch_ns_reference = INVALID_TIME, .delta_to_epoch_ns = INVALID_TIME}

// Safety: This function is assumed never to raise exceptions by callers when raise_on_failure == false
long monotonic_wall_time_now_ns(bool raise_on_failure);

// Safety: This function is assumed never to raise exceptions by callers when raise_on_failure == false
long system_epoch_time_now_ns(bool raise_on_failure);

long monotonic_to_system_epoch_ns(monotonic_to_system_epoch_state *state, long monotonic_wall_time_ns);

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
datadog-2.2.0 ext/datadog_profiling_native_extension/time_helpers.h
ddtrace-1.23.3 ext/datadog_profiling_native_extension/time_helpers.h
ddtrace-1.23.2 ext/datadog_profiling_native_extension/time_helpers.h
datadog-2.1.0 ext/datadog_profiling_native_extension/time_helpers.h
datadog-2.0.0 ext/datadog_profiling_native_extension/time_helpers.h
ddtrace-1.23.1 ext/datadog_profiling_native_extension/time_helpers.h
datadog-2.0.0.beta2 ext/datadog_profiling_native_extension/time_helpers.h
ddtrace-1.22.0 ext/datadog_profiling_native_extension/time_helpers.h
datadog-2.0.0.beta1 ext/datadog_profiling_native_extension/time_helpers.h
ddtrace-1.21.1 ext/datadog_profiling_native_extension/time_helpers.h
ddtrace-1.21.0 ext/datadog_profiling_native_extension/time_helpers.h
ddtrace-1.20.0 ext/ddtrace_profiling_native_extension/time_helpers.h