Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Holzer
waLBerla
Commits
71a7b79f
Commit
71a7b79f
authored
Apr 12, 2019
by
Sebastian Eibl
Browse files
added stream output to Timer
parent
e1bfd140
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/core/timing/Timer.h
View file @
71a7b79f
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment