ClockCycleCounter.h Example File
multimedia/spectrum/3rdparty/fftreal/stopwatch/ClockCycleCounter.h
#if ! defined (stopwatch_ClockCycleCounter_HEADER_INCLUDED)
#define stopwatch_ClockCycleCounter_HEADER_INCLUDED
#if defined (_MSC_VER)
#pragma once
#pragma warning (4 : 4250) // "Inherits via dominance."
#endif
#include "def.h"
#include "Int64.h"
namespace stopwatch
{
class ClockCycleCounter
{
public:
ClockCycleCounter ();
stopwatch_FORCEINLINE void
start ();
stopwatch_FORCEINLINE void
stop_lap ();
Int64 get_time_total () const;
Int64 get_time_best_lap () const;
protected:
private:
void compute_clk_mul ();
void compute_measure_time_total ();
void compute_measure_time_lap ();
static void spend_time ();
static stopwatch_FORCEINLINE Int64
read_clock_counter ();
Int64 _start_time;
Int64 _state;
Int64 _best_score;
static Int64 _measure_time_total;
static Int64 _measure_time_lap;
static int _clk_mul;
static bool _init_flag;
private:
ClockCycleCounter (const ClockCycleCounter &other);
ClockCycleCounter &
operator = (const ClockCycleCounter &other);
bool operator == (const ClockCycleCounter &other);
bool operator != (const ClockCycleCounter &other);
};
}
#include "ClockCycleCounter.hpp"
#endif // stopwatch_ClockCycleCounter_HEADER_INCLUDED