aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/WallClockTimer.cpp
diff options
context:
space:
mode:
authorNina Drozd <nina.drozd@arm.com>2018-09-27 11:53:34 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-10 16:16:57 +0100
commit2d9dd36fb6bc20b370701ab15463359b9db35f18 (patch)
treecc8dc033dd61ee4ec306201c50564a4f59cf79d9 /src/armnn/WallClockTimer.cpp
parent69851b525b9040ee7bf4b796efe74d473bc4e321 (diff)
downloadarmnn-2d9dd36fb6bc20b370701ab15463359b9db35f18.tar.gz
IVGCVSW-1821 - taking out scale factor again as it's polluting the WallClockTimer interface
Change-Id: Ia90b709ddfff321dbc218add4ab19737f68a44bf
Diffstat (limited to 'src/armnn/WallClockTimer.cpp')
-rw-r--r--src/armnn/WallClockTimer.cpp32
1 files changed, 6 insertions, 26 deletions
diff --git a/src/armnn/WallClockTimer.cpp b/src/armnn/WallClockTimer.cpp
index 911b0147e0..570b69077a 100644
--- a/src/armnn/WallClockTimer.cpp
+++ b/src/armnn/WallClockTimer.cpp
@@ -4,7 +4,6 @@
//
#include "WallClockTimer.hpp"
-#include "armnn/Exceptions.hpp"
namespace armnn
{
@@ -28,34 +27,15 @@ void WallClockTimer::Stop()
m_Stop = clock::now();
}
-void WallClockTimer::SetScaleFactor(Measurement::Unit measurementUnit)
-{
- switch(measurementUnit)
- {
- case Measurement::TIME_MS:
- m_ScaleFactor = 1.f;
- break;
- case Measurement::TIME_US:
- m_ScaleFactor = 1000.f;
- break;
- case Measurement::TIME_NS:
- m_ScaleFactor = 1000000.f;
- break;
- default:
- throw InvalidArgumentException("Invalid scale used");
- }
- m_Unit = measurementUnit;
-}
-
std::vector<Measurement> WallClockTimer::GetMeasurements() const
{
- const auto delta = std::chrono::duration<double, std::milli>(m_Stop - m_Start);
- const auto startTimeMs = std::chrono::duration<double, std::milli>(m_Start.time_since_epoch());
- const auto stopTimeMs = std::chrono::duration<double, std::milli>(m_Stop.time_since_epoch());
+ const auto delta = std::chrono::duration<double, std::micro>(m_Stop - m_Start);
+ const auto startTimeMs = std::chrono::duration<double, std::micro>(m_Start.time_since_epoch());
+ const auto stopTimeMs = std::chrono::duration<double, std::micro>(m_Stop.time_since_epoch());
- return { { WALL_CLOCK_TIME, delta.count() * m_ScaleFactor, m_Unit },
- { WALL_CLOCK_TIME_START, startTimeMs.count() * m_ScaleFactor, m_Unit },
- { WALL_CLOCK_TIME_STOP, stopTimeMs.count() * m_ScaleFactor, m_Unit } };
+ return { { WALL_CLOCK_TIME, delta.count(), Measurement::Unit::TIME_US },
+ { WALL_CLOCK_TIME_START, startTimeMs.count(), Measurement::Unit::TIME_US },
+ { WALL_CLOCK_TIME_STOP, stopTimeMs.count(), Measurement::Unit::TIME_US } };
}
} //namespace armnn