From 183c7141e2674b07441655a1f590688d8b1886a4 Mon Sep 17 00:00:00 2001 From: Mathias Labeyrie Date: Wed, 5 Nov 2014 14:44:51 +0100 Subject: [PATCH] performance test for glm::fastCos --- test/gtx/gtx_fast_trigonometry.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/gtx/gtx_fast_trigonometry.cpp b/test/gtx/gtx_fast_trigonometry.cpp index c7ad3e6e..d3787708 100644 --- a/test/gtx/gtx_fast_trigonometry.cpp +++ b/test/gtx/gtx_fast_trigonometry.cpp @@ -9,10 +9,36 @@ #include #include +#include +#include + +namespace fastCos{ + 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_fastCos)); + std::printf("cos Time %d clocks\n", static_cast(time_cos)); + return time_fastCos < time_cos ? 0 : 1; + } +} + int main() { int Error(0); + Error += ::fastCos::perf(); + return Error; }