commit 82dc8990419d2d5329110828b63e8a303b83b1ee
parent cca59400847b1a8edebba9191b7f20f47557a9d1
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Wed, 21 Feb 2018 19:06:27 +0100
Add timing information in a test.
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/test_senc_many_triangles.c b/src/test_senc_many_triangles.c
@@ -20,6 +20,8 @@
#include <rsys/double3.h>
+#include <rsys/clock_time.h>
+
struct s3dut_context {
struct s3dut_mesh_data data;
struct context ctx;
@@ -75,6 +77,8 @@ main(int argc, char** argv)
unsigned count;
unsigned cyl_trg_count, cyl_vrtx_count;
int i;
+ char dump[64];
+ struct time t0, t1;
(void) argc, (void) argv;
CHK(mem_init_proxy_allocator(&allocator, &mem_default_allocator) == RES_OK);
@@ -106,7 +110,12 @@ main(int argc, char** argv)
== RES_OK);
}
S3DUT(mesh_ref_put(cyl));
+
+ time_current(&t0);
CHK(senc_scene_analyze(scn, &desc) == RES_OK);
+ time_sub(&t0, time_current(&t1), &t0);
+ time_dump(&t0, TIME_MSEC | TIME_SEC | TIME_MIN, NULL, dump, sizeof(dump));
+ printf("Scene analyzed in: %s\n", dump);
CHK(senc_descriptor_get_global_vertices_count(desc, &count) == RES_OK);
CHK(count == NB_CYL * cyl_vrtx_count);