Main MRPT website > C++ reference
MRPT logo
CTicTac.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | The Mobile Robot Programming Toolkit (MRPT) C++ library |
3  | |
4  | http://www.mrpt.org/ |
5  | |
6  | Copyright (C) 2005-2012 University of Malaga |
7  | |
8  | This software was written by the Machine Perception and Intelligent |
9  | Robotics Lab, University of Malaga (Spain). |
10  | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
11  | |
12  | This file is part of the MRPT project. |
13  | |
14  | MRPT is free software: you can redistribute it and/or modify |
15  | it under the terms of the GNU General Public License as published by |
16  | the Free Software Foundation, either version 3 of the License, or |
17  | (at your option) any later version. |
18  | |
19  | MRPT is distributed in the hope that it will be useful, |
20  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
21  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22  | GNU General Public License for more details. |
23  | |
24  | You should have received a copy of the GNU General Public License |
25  | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
26  | |
27  +---------------------------------------------------------------------------+ */
28 #ifndef CTICTAC_H
29 #define CTICTAC_H
30 
31 #include <mrpt/utils/utils_defs.h>
32 
33 namespace mrpt
34 {
35 namespace utils
36 {
37  /** This class implements a high-performance stopwatch.
38  * Typical resolution is about 1e-6 seconds.
39  * \note The class is named after the Spanish equivalent of "Tic-Toc" ;-)
40  * \ingroup mrpt_base_grp
41  */
43  {
44  private:
45  uint8_t largeInts[64];
46  public:
47  /** Default constructor.
48  */
49  CTicTac();
50 
51  /** Destructor.
52  */
53  virtual ~CTicTac();
54 
55  CTicTac(const CTicTac& o)
56  {
57  THROW_EXCEPTION("CTicTac objects cannot be copied.");
58  }
59 
60  CTicTac & operator =(const CTicTac& o)
61  {
62  THROW_EXCEPTION("CTicTac objects cannot be copied.");
63  }
64 
65  /** Starts the stopwatch
66  * \sa Tac
67  */
68  void Tic();
69 
70  /** Stops the stopwatch
71  * \return Returns the ellapsed time in seconds.
72  * \sa Tic
73  */
74  double Tac();
75 
76  }; // End of class def.
77 
78  } // End of namespace
79 } // End of namespace
80 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013