source: trunk/demos/spectrum/3rdparty/fftreal/stopwatch/StopWatch.h

Last change on this file was 769, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

File size: 2.4 KB
Line 
1/*****************************************************************************
2
3 StopWatch.h
4 Copyright (c) 2005 Laurent de Soras
5
6Utility class based on ClockCycleCounter to measure the unit time of a
7repeated operation.
8
9--- Legal stuff ---
10
11This library is free software; you can redistribute it and/or
12modify it under the terms of the GNU Lesser General Public
13License as published by the Free Software Foundation; either
14version 2.1 of the License, or (at your option) any later version.
15
16This library is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19Lesser General Public License for more details.
20
21You should have received a copy of the GNU Lesser General Public
22License along with this library; if not, write to the Free Software
23Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
25*Tab=3***********************************************************************/
26
27
28
29#if ! defined (stopwatch_StopWatch_HEADER_INCLUDED)
30#define stopwatch_StopWatch_HEADER_INCLUDED
31
32#if defined (_MSC_VER)
33 #pragma once
34 #pragma warning (4 : 4250) // "Inherits via dominance."
35#endif
36
37
38
39/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
40
41#include "ClockCycleCounter.h"
42
43
44
45namespace stopwatch
46{
47
48
49
50class StopWatch
51{
52
53/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
54
55public:
56
57 StopWatch ();
58
59 stopwatch_FORCEINLINE void
60 start ();
61 stopwatch_FORCEINLINE void
62 stop_lap ();
63
64 double get_time_total (Int64 nbr_op) const;
65 double get_time_best_lap (Int64 nbr_op) const;
66
67
68
69/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
70
71protected:
72
73
74
75/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
76
77private:
78
79 ClockCycleCounter
80 _ccc;
81 Int64 _nbr_laps;
82
83
84
85/*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
86
87private:
88
89 StopWatch (const StopWatch &other);
90 StopWatch & operator = (const StopWatch &other);
91 bool operator == (const StopWatch &other);
92 bool operator != (const StopWatch &other);
93
94}; // class StopWatch
95
96
97
98} // namespace stopwatch
99
100
101
102#include "StopWatch.hpp"
103
104
105
106#endif // stopwatch_StopWatch_HEADER_INCLUDED
107
108
109
110/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
Note: See TracBrowser for help on using the repository browser.