From ef1c33d2d5ed09bb3609a9abf20c0b7d1f375acc Mon Sep 17 00:00:00 2001 From: Mathias Labeyrie Date: Wed, 5 Nov 2014 15:20:53 +0100 Subject: [PATCH] test perf fastAtan --- test/gtx/gtx_fast_trigonometry.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/gtx/gtx_fast_trigonometry.cpp b/test/gtx/gtx_fast_trigonometry.cpp index 7b27cbf4..051c5d2d 100644 --- a/test/gtx/gtx_fast_trigonometry.cpp +++ b/test/gtx/gtx_fast_trigonometry.cpp @@ -117,6 +117,27 @@ namespace fastAsin{ } } +namespace fastAtan{ + int perf() + { + const float begin = -glm::pi(); + const float end = glm::pi(); + float result = 0.f; + const std::clock_t timestamp1 = std::clock(); + for (float i = begin; i(time_fast)); + std::printf("atan Time %d clocks\n", static_cast(time_default)); + return time_fast < time_default ? 0 : 1; + } +} + int main() { @@ -127,6 +148,7 @@ int main() Error += ::fastTan::perf(); Error += ::fastAcos::perf(); Error += ::fastAsin::perf(); + Error += ::fastAtan::perf(); return Error; }