[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51442] trunk/blender/source/blender/ blenlib/PIL_time.h: add TIMEIT_VALUE_PRINT() macro for printing timing between start/end macros.

Campbell Barton ideasman42 at gmail.com
Sat Oct 20 12:37:16 CEST 2012


Revision: 51442
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51442
Author:   campbellbarton
Date:     2012-10-20 10:37:15 +0000 (Sat, 20 Oct 2012)
Log Message:
-----------
add TIMEIT_VALUE_PRINT() macro for printing timing between start/end macros.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/PIL_time.h

Modified: trunk/blender/source/blender/blenlib/PIL_time.h
===================================================================
--- trunk/blender/source/blender/blenlib/PIL_time.h	2012-10-20 10:28:34 UTC (rev 51441)
+++ trunk/blender/source/blender/blenlib/PIL_time.h	2012-10-20 10:37:15 UTC (rev 51442)
@@ -30,7 +30,6 @@
  *  \brief Platform independent time functions.
  */
 
- 
 #ifndef __PIL_TIME_H__
 #define __PIL_TIME_H__
 
@@ -61,20 +60,24 @@
 		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__ */




More information about the Bf-blender-cvs mailing list