Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/PIL_time.h')
-rw-r--r--source/blender/blenlib/PIL_time.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h
index c3e7e8486d9..3983b5099ff 100644
--- a/source/blender/blenlib/PIL_time.h
+++ b/source/blender/blenlib/PIL_time.h
@@ -87,6 +87,26 @@ void PIL_sleep_ms(int ms);
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