forked from bartvdbraak/blender
add TIMEIT_VALUE_PRINT() macro for printing timing between start/end macros.
This commit is contained in:
parent
a99b377167
commit
1820d3529c
@ -30,7 +30,6 @@
|
|||||||
* \brief Platform independent time functions.
|
* \brief Platform independent time functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __PIL_TIME_H__
|
#ifndef __PIL_TIME_H__
|
||||||
#define __PIL_TIME_H__
|
#define __PIL_TIME_H__
|
||||||
|
|
||||||
@ -61,20 +60,24 @@ void PIL_sleep_ms(int ms);
|
|||||||
double _timeit_##var = PIL_check_seconds_timer(); \
|
double _timeit_##var = PIL_check_seconds_timer(); \
|
||||||
printf("time start (" #var "): " AT "\n"); \
|
printf("time start (" #var "): " AT "\n"); \
|
||||||
fflush(stdout); \
|
fflush(stdout); \
|
||||||
{ (void)0 \
|
{ (void)0
|
||||||
|
|
||||||
|
|
||||||
#define TIMEIT_VALUE(var) (float)(PIL_check_seconds_timer() - _timeit_##var)
|
#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) \
|
#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); \
|
fflush(stdout); \
|
||||||
} (void)0 \
|
} (void)0
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !__PIL_TIME_H__ */
|
#endif /* !__PIL_TIME_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user