MRPT  2.0.2
system/CTicTac.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 namespace mrpt::system
12 {
13 /** A high-performance stopwatch, with typical resolution of nanoseconds.
14  * \note The class is named after the Spanish equivalent of "Tic-Toc" ;-)
15  * \ingroup mrpt_system_grp
16  */
17 class CTicTac
18 {
19  public:
20  /** Default constructor. Implicitly calls Tic() */
21  CTicTac() noexcept;
22  /** Starts the stopwatch. \sa Tac() */
23  void Tic() noexcept;
24  /** Stops the stopwatch. \return Returns the ellapsed time in seconds.
25  * \sa Tic() */
26  double Tac() noexcept;
27 
28  private:
29  alignas(16) unsigned long largeInts[4]{0, 0, 0, 0};
30 }; // End of class def.
31 
32 } // namespace mrpt::system
double Tac() noexcept
Stops the stopwatch.
Definition: CTicTac.cpp:86
A high-performance stopwatch, with typical resolution of nanoseconds.
CTicTac() noexcept
Default constructor.
Definition: CTicTac.cpp:59
void Tic() noexcept
Starts the stopwatch.
Definition: CTicTac.cpp:75
unsigned long largeInts[4]



Page generated by Doxygen 1.8.14 for MRPT 2.0.2 Git: 9b4fd2465 Mon May 4 16:59:08 2020 +0200 at lun may 4 17:26:07 CEST 2020