Created
June 22, 2013 11:31
-
-
Save m42a/5840543 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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