#define SCL_DEBUG_ELAPASED_TIME_END() SCL_DEBUG_ELAPASED_TIME(__FILE__, __LINE__, __FUNCTION__, MEASURE_END);
//#define SCL_DEBUG() SCL_DEBUG_TIME(__FILE__, __LINE__, __FUNCTION__ );
-#define SCL_DEBUG() NULL;
+#define SCL_DEBUG()
#define SCL_DEBUG_START() \
static struct timeval t0;\
gettimeofday(&t1, NULL);\
float etime;\
etime = ((t1.tv_sec * 1000000 + t1.tv_usec) - (t0.tv_sec * 1000000 + t0.tv_usec))/1000000.0;\
- printf("[%-20.20s][%04d][%s] E: " mc_green "%f" mc_normal " (S:%u) \n", __FILE__, __LINE__, __FUNCTION__, etime, (t0.tv_sec * 1000000 + t0.tv_usec) );
+ printf("[%-20.20s][%04d][%s] E: " mc_green "%f" mc_normal " (S:%lu) \n", __FILE__, __LINE__, __FUNCTION__, etime, (t0.tv_sec * 1000000 + t0.tv_usec) );
#define IO_TEST
if (strncmp(str, "get_", 4) == 0) {
//printf("[%-20.20s]%04d [T:%u][E:" mc_red "%f" mc_normal "]" mc_normal " %s" mc_normal "\n", pFileStr, line, (t1.tv_sec * 1000000 + t1.tv_usec), etime, str);
} else {
- printf("[%-20.20s]%04d [T:%u][E:" mc_red "%f" mc_normal "]" mc_blue " %s" mc_normal "\n", pFileStr, line, (t1.tv_sec * 1000000 + t1.tv_usec), etime, str);
+ printf("[%-20.20s]%04d [T:%lu][E:" mc_red "%f" mc_normal "]" mc_blue " %s" mc_normal "\n", pFileStr, line, (t1.tv_sec * 1000000 + t1.tv_usec), etime, str);
}
t0 = t1;
}
+ return etime;
}
/* Measure elapased time */
{
float etime;
etime = ((t1.tv_sec * 1000000 + t1.tv_usec) - (t0.tv_sec * 1000000 + t0.tv_usec))/1000000.0;
- printf("[%s] elap-time = " mc_green "%f" mc_normal " (%u~%u) \n", str, etime, (t0.tv_sec * 1000000 + t0.tv_usec), (t1.tv_sec * 1000000 + t1.tv_usec));
+ printf("[%s] elap-time = " mc_green "%f" mc_normal " (%lu~%lu) \n", str, etime, (t0.tv_sec * 1000000 + t0.tv_usec), (t1.tv_sec * 1000000 + t1.tv_usec));
return etime;
}
static struct timeval s_tv2;
static int s_start_line = 0;
static int s_end_line = 0;
+ float etime = 0.0;
if (type == MEASURE_START) {
gettimeofday(&s_tv1, NULL);
s_start_line = line;
- printf("[%-20.20s]%04d [T:%u]" mc_blue " %s" mc_normal "\n", fileStr, line, (s_tv1.tv_sec * 1000000 + s_tv1.tv_usec), str);
+ printf("[%-20.20s]%04d [T:%lu]" mc_blue " %s" mc_normal "\n", fileStr, line, (s_tv1.tv_sec * 1000000 + s_tv1.tv_usec), str);
} else if (type == MEASURE_END) {
gettimeofday(&s_tv2, NULL);
s_end_line = line;
char printStr[100];
snprintf(printStr, 100, "%s(Line:%d~%d)", str, s_start_line, s_end_line);
- _SCL_DEBUG_ELAPASED_TIME(printStr, s_tv1, s_tv2);
+ etime = _SCL_DEBUG_ELAPASED_TIME(printStr, s_tv1, s_tv2);
}
+ return etime;
}
#endif