2012-08-24 21:56:45 +02:00
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
// Copyright 2011 Intel Corporation
|
|
|
|
// All Rights Reserved
|
|
|
|
//
|
|
|
|
// Permission is granted to use, copy, distribute and prepare derivative works of this
|
|
|
|
// software for any purpose and without fee, provided, that the above copyright notice
|
|
|
|
// and this statement appear in all copies. Intel makes no representations about the
|
|
|
|
// suitability of this software for any purpose. THIS SOFTWARE IS PROVIDED "AS IS."
|
|
|
|
// INTEL SPECIFICALLY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, AND ALL LIABILITY,
|
|
|
|
// INCLUDING CONSEQUENTIAL AND OTHER INDIRECT DAMAGES, FOR THE USE OF THIS SOFTWARE,
|
|
|
|
// INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PROPRIETARY RIGHTS, AND INCLUDING THE
|
|
|
|
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Intel does not
|
|
|
|
// assume any responsibility for any errors which may appear in this software nor any
|
|
|
|
// responsibility to update it.
|
|
|
|
//
|
|
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
2012-08-30 22:56:42 +02:00
|
|
|
// Forward declare the private implementation of the class that will actually implement
|
|
|
|
// the timing features. This class is defined in each module depending on the platform...
|
|
|
|
class StopWatchImpl;
|
2012-08-24 21:56:45 +02:00
|
|
|
|
|
|
|
// A simple stopwatch class using Windows' high-resolution performance counters.
|
|
|
|
class StopWatch
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StopWatch();
|
2012-08-30 22:56:42 +02:00
|
|
|
StopWatch(const StopWatch &);
|
|
|
|
|
|
|
|
~StopWatch();
|
|
|
|
|
|
|
|
StopWatch &operator=(const StopWatch &);
|
2012-08-24 21:56:45 +02:00
|
|
|
|
|
|
|
void Start();
|
|
|
|
void Stop();
|
|
|
|
void Reset();
|
|
|
|
|
|
|
|
double TimeInSeconds() const;
|
|
|
|
double TimeInMilliseconds() const;
|
|
|
|
double TimeInMicroseconds() const;
|
|
|
|
|
|
|
|
private:
|
2012-08-30 22:56:42 +02:00
|
|
|
StopWatchImpl *impl;
|
2012-08-24 21:56:45 +02:00
|
|
|
};
|