Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View bench.cpp
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
#include "foo.h"
 
void bench()
{
Radians rad(PI);
Radians tmp(0);
 
for (int i=0; i<100000000; ++i)
{
tmp=mul(rad);
rad=div(tmp);
}
}
 
void bench_ref()
{
Radians rad(PI);
Radians tmp(0);
 
for (int i=0; i<100000000; ++i)
{
tmp=mul_ref(rad);
rad=div_ref(tmp);
}
}
View bench.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include "foo.h"
 
Radians mul(Radians r)
{
return r*2;
}
Radians div(Radians r)
{
return r/2;
}
 
Radians mul_ref(const Radians &r)
{
return r*2;
}
Radians div_ref(const Radians &r)
{
return r/2;
}
View bench.cpp
1 2 3 4 5 6 7
#include "degrad.h"
 
Radians mul(Radians);
Radians div(Radians);
 
Radians mul_ref(const Radians);
Radians div_ref(const Radians);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.