OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BasChronometer.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_COM_BAS_BASCHRONOMETER_HPP
2 #define __OPENTREP_COM_BAS_BASCHRONOMETER_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // Boost Date-Time (http://boost.org/doc/html/date_time/posix_time.html)
8 #include <boost/date_time/posix_time/posix_time.hpp>
9 
10 namespace OPENTREP {
11 
15  struct BasChronometer {
20 
26  void start ();
27 
31  std::string getStart () const {
32  return boost::posix_time::to_simple_string (_startTime);
33  }
34 
40  double elapsed () const;
41 
42  private:
46  boost::posix_time::ptime _startTime;
47 
51  bool _startTimeLaunched;
52  };
53 
54 }
55 #endif // __OPENTREP_COM_BAS_BASCHRONOMETER_HPP
Structure allowing measuring the time elapsed between two events.
std::string getStart() const