Skip to content

Commit

Permalink
Added MEASURE_FLUSH for single line update
Browse files Browse the repository at this point in the history
  • Loading branch information
cassinaj committed Jan 3, 2016
1 parent 18595a8 commit 5e79b19
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/fl/util/profiling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@
<< ((profiling_end_time.tv_sec - profiling_start_time.tv_sec) * 1000000u\
+ profiling_end_time.tv_usec - profiling_start_time.tv_usec) /1000000. \
<< " s" << std::endl; gettimeofday(&profiling_start_time, NULL);
#define MEASURE_FLUSH(text)\
gettimeofday(&profiling_end_time, NULL);\
std::cout << "\r";\
std::cout.flush();\
std::cout << "time for " << text << " " \
<< std::setprecision(9) << std::fixed\
<< ((profiling_end_time.tv_sec - profiling_start_time.tv_sec) * 1000000u\
+ profiling_end_time.tv_usec - profiling_start_time.tv_usec) /1000000. \
<< " s"; gettimeofday(&profiling_start_time, NULL);
#else
#define PRINT(object)
#define INIT_PROFILING
Expand Down

0 comments on commit 5e79b19

Please sign in to comment.