//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see .
//
//-----------------------------------------------------------------------------
//
// $Revision: 3468 $
// $Author: moebius $
// $Date: 2008-10-17 14:58:52 +0200 (Fri, 17 Oct 2008) $
//
//=============================================================================
// (C) Copyright 2015 by Autodesk, Inc.
//
// The information contained herein is confidential, proprietary
// to Autodesk, Inc., and considered a trade secret as defined
// in section 499C of the penal code of the State of California.
// Use of this information by anyone other than authorized
// employees of Autodesk, Inc. is granted only under a written
// non-disclosure agreement, expressly prescribing the scope
// and manner of such use.
//=============================================================================
//
// CLASS StopWatch
//
//=============================================================================
#ifndef BASE_STOPWATCH_HH_INCLUDED
#define BASE_STOPWATCH_HH_INCLUDED
#include
namespace Base {
//== CLASS DEFINITION =========================================================
/** \class StopWatch StopWatch.hh
This class can be used for measuring time, providing optimal granularity
for the current platform.
**/
class BASEDLLEXPORT StopWatch
{
public:
/// Constructor
StopWatch();
/// Destructor
~StopWatch();
/// Start time measurement
void start();
/// Restart, return time elapsed until now.
double restart();
/// Stop time measurement, return time.
double stop();
/// Get the total time in milli-seconds (watch has to be stopped).
double elapsed() const;
private:
class Impl;
Impl* impl_;
private:
// disable copy and assignment
StopWatch(const StopWatch&);
StopWatch& operator=(const StopWatch&);
};
//=============================================================================
} // namespace Base
//=============================================================================
#endif//BASE_STOPWATCH_HH_INCLUDED
//=============================================================================