Commit 71a7b79f authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

added stream output to Timer

parent e1bfd140
......@@ -28,6 +28,8 @@
#include "WcPolicy.h"
#include "core/DataTypes.h"
#include <iomanip>
#include <iostream>
#include <limits>
......@@ -442,6 +444,24 @@ inline void Timer<TP>::merge( const Timer<TP> & other )
//**********************************************************************************************************************
//======================================================================================================================
//
// OSTREAM OVERLOAD
//
//======================================================================================================================
template< typename TP > // Timing policy
std::ostream & operator<< ( std::ostream & os, const Timer<TP> & timer )
{
os << std::fixed << std::setprecision(3) <<
"average: " << timer.average() <<
" | min: " << timer.min() <<
" | max: " << timer.max() <<
" | variance: " << timer.variance();
return os;
}
} // namespace timing
typedef timing::Timer<timing::CpuPolicy> CpuTimer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment