- don't show on empty data
authorBart Polot <bart@net.in.tum.de>
Tue, 21 Aug 2012 16:02:23 +0000 (16:02 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 21 Aug 2012 16:02:23 +0000 (16:02 +0000)
src/mesh/gnunet-service-mesh.c

index 3f8dba822e0294e3e6f89ed47b11b451a18b10b1..2189d611dba624d9e9faaef7ea9092e81b130d25 100644 (file)
@@ -88,7 +88,9 @@ do {\
   __sum += __diff;\
   __count++;\
 } while (0)
-#define INTERVAL_SHOW GNUNET_log (GNUNET_ERROR_TYPE_INFO, "AVG process time: %f ns\n", __sum/__count)
+#define INTERVAL_SHOW \
+if (0 < __count)\
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "AVG process time: %f ns\n", __sum/__count)
 #else
 #define INTERVAL_START
 #define INTERVAL_END