demos/spectrum/3rdparty/fftreal/stopwatch/StopWatch.h
changeset 25 e24348a560a6
equal deleted inserted replaced
23:89e065397ea6 25:e24348a560a6
       
     1 /*****************************************************************************
       
     2 
       
     3         StopWatch.h
       
     4         Copyright (c) 2005 Laurent de Soras
       
     5 
       
     6 Utility class based on ClockCycleCounter to measure the unit time of a
       
     7 repeated operation.
       
     8 
       
     9 --- Legal stuff ---
       
    10 
       
    11 This library is free software; you can redistribute it and/or
       
    12 modify it under the terms of the GNU Lesser General Public
       
    13 License as published by the Free Software Foundation; either
       
    14 version 2.1 of the License, or (at your option) any later version.
       
    15 
       
    16 This library is distributed in the hope that it will be useful,
       
    17 but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    19 Lesser General Public License for more details.
       
    20 
       
    21 You should have received a copy of the GNU Lesser General Public
       
    22 License along with this library; if not, write to the Free Software
       
    23 Foundation, 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 
       
    45 namespace stopwatch
       
    46 {
       
    47 
       
    48 
       
    49 
       
    50 class StopWatch
       
    51 {
       
    52 
       
    53 /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
       
    54 
       
    55 public:
       
    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 
       
    71 protected:
       
    72 
       
    73 
       
    74 
       
    75 /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
       
    76 
       
    77 private:
       
    78 
       
    79 	ClockCycleCounter
       
    80 						_ccc;
       
    81 	Int64				_nbr_laps;
       
    82 
       
    83 
       
    84 
       
    85 /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
       
    86 
       
    87 private:
       
    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 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/