Skip to content

Commit

Permalink
Macro đo thời gian
Browse files Browse the repository at this point in the history
  • Loading branch information
bangoc committed Jan 3, 2022
1 parent 604e85d commit 577ee88
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions base/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,10 @@
}\
} while (0)

#define BENCH1_START() \
long _bench1_start = clock()
#define BENCH1_END() \
long _bench1_end = clock(); \
printf("Time: %.3f\n", (double)(_bench1_end - _bench1_start)/CLOCKS_PER_SEC)

#endif // BASE_CORE_H_

0 comments on commit 577ee88

Please sign in to comment.