From 7de6e223182363d30b941a1c72d5af411fdf8845 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 4 Nov 2016 09:47:22 +0000 Subject: - refactor function timing code --- src/cadet/cadet.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/cadet/cadet.h') diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h index 3ff93c254..049f3a85a 100644 --- a/src/cadet/cadet.h +++ b/src/cadet/cadet.h @@ -36,7 +36,22 @@ extern "C" #include -#define CADET_DEBUG GNUNET_YES +#if !defined(GNUNET_CULL_LOGGING) + #define CADET_TIMING_START \ + struct GNUNET_TIME_Absolute __timestamp;\ + __timestamp = GNUNET_TIME_absolute_get() + + #define CADET_TIMING_END \ + struct GNUNET_TIME_Relative __duration;\ + __duration = GNUNET_TIME_absolute_get_duration (__timestamp);\ + LOG (GNUNET_ERROR_TYPE_INFO, " %s duration %s\n",\ + __FUNCTION__,\ + GNUNET_STRINGS_relative_time_to_string (__duration, GNUNET_YES)); +#else + #define CADET_TIMING_START + #define CADET_TIMING_END +#endif + #include "platform.h" #include "gnunet_util_lib.h" -- cgit v1.2.3