libpnicore
benchmark_result.hpp
1 //
2 // (c) Copyright 2012 DESY, Eugen Wintersberger <eugen.wintersberger@desy.de>
3 //
4 // This file is part of libpniio.
5 //
6 // libpniio is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // libpniio is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with libpniio. If not, see <http://www.gnu.org/licenses/>.
18 //
19 // ============================================================================
20 //
21 // Created on: Oct 24, 2012
22 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
23 //
24 #pragma once
25 
26 #include <iostream>
27 #include "../types.hpp"
28 
29 namespace pni{
30 namespace core{
31 
43  {
44  private:
48  string _unit;
49  public:
50  //====================constructors and destructor===================
53  _time(0.),
54  _unit("")
55  {}
56 
57  //------------------------------------------------------------------
65  _time(time),
66  _unit(unit)
67  {}
68 
69  //==================public member functions=========================
71  float64 time() const { return _time; }
72 
73  //------------------------------------------------------------------
75  string unit() const { return _unit; }
76 
77  };
78 
83  std::ostream &operator<<(std::ostream &o,const benchmark_result &r);
84 
85 //end of namespace
86 }
87 }
string _unit
unit of time
Definition: benchmark_result.hpp:48
float64 time() const
get time
Definition: benchmark_result.hpp:71
string unit() const
get the unit
Definition: benchmark_result.hpp:75
result of a single benchmark
Definition: benchmark_result.hpp:42
std::ostream & operator<<(std::ostream &o, const benchmark_result &r)
output operator for benchmark result
Definition: add_op.hpp:29
benchmark_result(float64 time, const string &unit)
constructor
Definition: benchmark_result.hpp:64
float64 _time
time required for reading data
Definition: benchmark_result.hpp:46
benchmark_result()
default constructor
Definition: benchmark_result.hpp:52
double float64
64Bit IEEE floating point type
Definition: types/types.hpp:56