diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-20 14:37:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-20 14:37:15 +0400 |
commit | 1820d3529c7fe37d4a03aca975881c4fc4304f38 (patch) | |
tree | 54ae3197a0673ca4a443fa6aff95bc73a42aa384 /source/blender/blenlib | |
parent | a99b377167a6c073faa8bfd7398517084c66efa5 (diff) |
add TIMEIT_VALUE_PRINT() macro for printing timing between start/end macros.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/PIL_time.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h index 288d2fe78e5..b8f895c5c82 100644 --- a/source/blender/blenlib/PIL_time.h +++ b/source/blender/blenlib/PIL_time.h @@ -30,7 +30,6 @@ * \brief Platform independent time functions. */ - #ifndef __PIL_TIME_H__ #define __PIL_TIME_H__ @@ -61,20 +60,24 @@ void PIL_sleep_ms(int ms); double _timeit_##var = PIL_check_seconds_timer(); \ printf("time start (" #var "): " AT "\n"); \ fflush(stdout); \ - { (void)0 \ - + { (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)); \ + printf("time end (" #var "): %.6f" " " AT "\n", TIMEIT_VALUE(var)); \ fflush(stdout); \ -} (void)0 \ +} (void)0 #ifdef __cplusplus } #endif -#endif /* !__PIL_TIME_H__ */ +#endif /* !__PIL_TIME_H__ */ |