aboutsummaryrefslogtreecommitdiff
path: root/bench/tests/BenchVec3f.c
diff options
context:
space:
mode:
Diffstat (limited to 'bench/tests/BenchVec3f.c')
-rw-r--r--bench/tests/BenchVec3f.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/bench/tests/BenchVec3f.c b/bench/tests/BenchVec3f.c
new file mode 100644
index 0000000..d4c0840
--- /dev/null
+++ b/bench/tests/BenchVec3f.c
@@ -0,0 +1,33 @@
+#include <BH/Bench.h>
+#include <BH/Math/Vec3f.h>
+#include <stdlib.h>
+
+
+BH_BENCH_TEST(Vec3f)
+{
+ float a[3], b[3];
+
+ a[0] = (rand() % 100) / 200.0;
+ a[1] = (rand() % 100) / 200.0;
+ a[2] = (rand() % 100) / 200.0;
+
+ b[0] = (rand() % 100) / 200.0;
+ b[1] = (rand() % 100) / 200.0;
+ b[2] = (rand() % 100) / 200.0;
+
+ while (BH_BenchIter(state))
+ {
+ BH_Vec3fAdd(a, b, a);
+ }
+}
+
+
+int main(int argc, char **argv)
+{
+ BH_UNUSED(argc);
+ BH_UNUSED(argv);
+
+ BH_BENCH_ADD(Vec3f);
+
+ return BH_BenchRun();
+}