diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-04 01:22:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-04 01:22:43 +0400 |
commit | 0994e7f96fd7b98ba3967ca44b93b93fa1c31920 (patch) | |
tree | e940d2effa5ddca225252f1082d44e498ff5ebe2 /source/blender/blenlib/PIL_time.h | |
parent | a54dd1155f4e476dda77e4d6bad5c100854b96bc (diff) |
move timeit macros into their own include, since they are only used for testing and unrelated to PIL_time.h typical use.
Diffstat (limited to 'source/blender/blenlib/PIL_time.h')
-rw-r--r-- | source/blender/blenlib/PIL_time.h | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h index 3983b5099ff..158559fa3d9 100644 --- a/source/blender/blenlib/PIL_time.h +++ b/source/blender/blenlib/PIL_time.h @@ -51,64 +51,8 @@ double PIL_check_seconds_timer(void); */ void PIL_sleep_ms(int ms); -/** Utility defines for timing. - * requires BLI_utildefines.h for 'AT' - * TIMEIT_VALUE returns the time since TIMEIT_START was called. - */ -#define TIMEIT_START(var) \ - { \ - double _timeit_##var = PIL_check_seconds_timer(); \ - printf("time start (" #var "): " AT "\n"); \ - fflush(stdout); \ - { (void)0 - -#define TIMEIT_VALUE(var) (float)(PIL_check_seconds_timer() - _timeit_##var) - -#define TIMEIT_VALUE_PRINT(var) \ - { \ - printf("time update(" #var "): %.6f" " " AT "\n", TIMEIT_VALUE(var));\ - fflush(stdout); \ - } (void)0 - -#define TIMEIT_END(var) \ - } \ - printf("time end (" #var "): %.6f" " " AT "\n", TIMEIT_VALUE(var)); \ - fflush(stdout); \ -} (void)0 - -/** - * Given some function/expression: - * TIMEIT_BENCH(some_function(), some_unique_description); - */ -#define TIMEIT_BENCH(expr, id) \ - { \ - TIMEIT_START(id); \ - (expr); \ - TIMEIT_END(id); \ - } (void)0 - -#define TIMEIT_BLOCK_INIT(what) \ - double _timeit_var_##what = 0; \ - (void) 0 - -#define TIMEIT_BLOCK_BEGIN(what) \ - { \ - double _timeit_block_start_##what = PIL_check_seconds_timer(); \ - { (void)0 - -#define TIMEIT_BLOCK_END(what) \ - } \ - _timeit_var_##what += PIL_check_seconds_timer() - _timeit_block_start_##what; \ - } (void)0 - -#define TIMEIT_BLOCK_STATS(what) \ - { \ - printf("%s time (in seconds): %f\n", #what, _timeit_var_##what); \ - fflush(stdout); \ - } (void)0 - #ifdef __cplusplus } #endif -#endif /* !__PIL_TIME_H__ */ +#endif /* __PIL_TIME_H__ */ |