[DEBUG] build is back

This commit is contained in:
Edouard DUPIN 2017-11-07 13:38:04 +01:00
parent 39e1afcf47
commit 65d692d009
3 changed files with 19 additions and 20 deletions

View File

@ -10,22 +10,23 @@
#include <etk/os/FSNode.hpp>
#include <echrono/echrono.hpp>
#include <ethread/Thread.hpp>
#include <ethread/tools.hpp>
#include <echrono/Steady.hpp>
#include <echrono/Duration.hpp>
class Performance {
private:
echrono::Steady m_timeStart;
echrono::Steady m_timeStop;
echrono::nanoseconds m_totalTimeProcessing;
echrono::nanoseconds m_minProcessing;
echrono::nanoseconds m_maxProcessing;
echrono::Duration m_totalTimeProcessing;
echrono::Duration m_minProcessing;
echrono::Duration m_maxProcessing;
int32_t m_totalIteration;
public:
Performance() :
m_totalTimeProcessing(0),
m_minProcessing(99999999999999LL),
m_maxProcessing(0),
m_totalTimeProcessing(echrono::nanoseconds(0)),
m_minProcessing(echrono::nanoseconds(99999999999999LL)),
m_maxProcessing(echrono::nanoseconds(0)),
m_totalIteration(0) {
}
@ -34,7 +35,7 @@ class Performance {
}
void toc() {
m_timeStop = echrono::Steady::now();
echrono::nanoseconds time = m_timeStop - m_timeStart;
echrono::Duration time = m_timeStop - m_timeStart;
m_minProcessing = etk::min(m_minProcessing, time);
m_maxProcessing = etk::max(m_maxProcessing, time);
m_totalTimeProcessing += time;
@ -42,13 +43,13 @@ class Performance {
}
echrono::nanoseconds getTotalTimeProcessing() {
echrono::Duration getTotalTimeProcessing() {
return m_totalTimeProcessing;
}
echrono::nanoseconds getMinProcessing() {
echrono::Duration getMinProcessing() {
return m_minProcessing;
}
echrono::nanoseconds getMaxProcessing() {
echrono::Duration getMaxProcessing() {
return m_maxProcessing;
}
int32_t getTotalIteration() {
@ -90,13 +91,13 @@ float performanceEqualizerType(audio::format _type) {
ethread::sleepMilliSeconds((1));
}
TEST_INFO(" blockSize=" << input.size() << " sample");
TEST_INFO(" min < avg < max =" << perfo.getMinProcessing().count() << "ns < "
<< perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration() << "ns < "
<< perfo.getMaxProcessing().count() << "ns ");
float avg = (float(((perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration())*sampleRate)/double(input.size()))/1000000000.0)*100.0;
TEST_INFO(" min < avg < max= " << (float((perfo.getMinProcessing().count()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < "
TEST_INFO(" min < avg < max =" << perfo.getMinProcessing() << " < "
<< perfo.getTotalTimeProcessing().toSeconds()*1000000000.0/perfo.getTotalIteration() << "ns < "
<< perfo.getMaxProcessing());
float avg = (float(((perfo.getTotalTimeProcessing().toSeconds()*1000000000.0/perfo.getTotalIteration())*sampleRate)/double(input.size()))/1000000000.0)*100.0;
TEST_INFO(" min < avg < max= " << (float((perfo.getMinProcessing().toSeconds()*1000000000.0*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < "
<< avg << "% < "
<< (float((perfo.getMaxProcessing().count()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "%");
<< (float((perfo.getMaxProcessing().toSeconds()*1000000000.0*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "%");
TEST_PRINT("type=" << _type << ": " << avg << "%");
return avg;
}

View File

@ -13,7 +13,6 @@ extern "C" {
#include <test-debug/debug.hpp>
#include <etk/os/FSNode.hpp>
#include <etk/math/Vector3D.hpp>
#include <etk/math/Matrix4.hpp>
const double speedSound = 340.29; // m/s

View File

@ -18,7 +18,6 @@ extern "C" {
#include <test-debug/debug.hpp>
#include <etk/os/FSNode.hpp>
#include <etk/math/Vector3D.hpp>
#include <etk/math/Matrix4.hpp>
const double speedSound = 340.29; // m/s