aboutsummaryrefslogtreecommitdiff
path: root/bench/tests/BenchVec3f.c
blob: d4c0840bce427a77fa4a4358de43dab4ef864c47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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();
}