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:
authorAndre Susano Pinto <andresusanopinto@gmail.com>2009-06-30 05:17:50 +0400
committerAndre Susano Pinto <andresusanopinto@gmail.com>2009-06-30 05:17:50 +0400
commite0cfafa6292cbcec5d49817583204a418308aac7 (patch)
tree29b20bec20f6d8380f6c05699c45324969301e44 /source/blender/render/intern/include/rayobject.h
parentdd7463bd4d0457a6b11515d14cce7871fe5f6fd5 (diff)
Measure build time...
*as expected it's a lot faster on BVH
Diffstat (limited to 'source/blender/render/intern/include/rayobject.h')
-rw-r--r--source/blender/render/intern/include/rayobject.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h
index 064341ae18b..53d96d6331f 100644
--- a/source/blender/render/intern/include/rayobject.h
+++ b/source/blender/render/intern/include/rayobject.h
@@ -120,4 +120,31 @@ int RE_rayobject_intersect(RayObject *r, Isect *i);
#define ISECT_EPSILON ((float)FLT_EPSILON)
+
+
+#if !defined(_WIN32)
+
+#include <sys/time.h>
+#include <time.h>
+#include <stdio.h>
+
+#define BENCH(a,name) \
+ do { \
+ double _t1, _t2; \
+ struct timeval _tstart, _tend; \
+ clock_t _clock_init = clock(); \
+ gettimeofday ( &_tstart, NULL); \
+ (a); \
+ gettimeofday ( &_tend, NULL); \
+ _t1 = ( double ) _tstart.tv_sec + ( double ) _tstart.tv_usec/ ( 1000*1000 ); \
+ _t2 = ( double ) _tend.tv_sec + ( double ) _tend.tv_usec/ ( 1000*1000 ); \
+ printf("BENCH:%s: %fs (real) %fs (cpu)\n", #name, _t2-_t1, (float)(clock()-_clock_init)/CLOCKS_PER_SEC);\
+ } while(0)
+#else
+
+#define BENCH(a) (a)
+
+#endif
+
+
#endif