aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet.h
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2016-11-04 09:47:22 +0000
committerBart Polot <bart@net.in.tum.de>2016-11-04 09:47:22 +0000
commit7de6e223182363d30b941a1c72d5af411fdf8845 (patch)
treec4a9dfc0a48d15d021ebef192e29d6252bcbb618 /src/cadet/cadet.h
parent8894f42d840e62b2054e2ec9d3531639124dcf1c (diff)
downloadgnunet-7de6e223182363d30b941a1c72d5af411fdf8845.tar.gz
gnunet-7de6e223182363d30b941a1c72d5af411fdf8845.zip
- refactor function timing code
Diffstat (limited to 'src/cadet/cadet.h')
-rw-r--r--src/cadet/cadet.h17
1 files changed, 16 insertions, 1 deletions
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"
36 36
37#include <stdint.h> 37#include <stdint.h>
38 38
39#define CADET_DEBUG GNUNET_YES 39#if !defined(GNUNET_CULL_LOGGING)
40 #define CADET_TIMING_START \
41 struct GNUNET_TIME_Absolute __timestamp;\
42 __timestamp = GNUNET_TIME_absolute_get()
43
44 #define CADET_TIMING_END \
45 struct GNUNET_TIME_Relative __duration;\
46 __duration = GNUNET_TIME_absolute_get_duration (__timestamp);\
47 LOG (GNUNET_ERROR_TYPE_INFO, " %s duration %s\n",\
48 __FUNCTION__,\
49 GNUNET_STRINGS_relative_time_to_string (__duration, GNUNET_YES));
50#else
51 #define CADET_TIMING_START
52 #define CADET_TIMING_END
53#endif
54
40 55
41#include "platform.h" 56#include "platform.h"
42#include "gnunet_util_lib.h" 57#include "gnunet_util_lib.h"