Newer
Older
* \author Wenqing Wang
* \date 2012-05-10, 2014-10.10
* \brief Definition of the RunTime class.
*
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
Tom Fischer
committed
*/
public:
/// Start the timer.
void start()
{
#ifdef USE_PETSC
start_time_ = MPI_Wtime();
start_time_ = std::chrono::system_clock::now();
/// Get the elapsed time in seconds.
double elapsed() const
{
#ifdef USE_PETSC
return MPI_Wtime() - start_time_;
return duration<double>(system_clock::now() - start_time_).count();
double start_time_ = std::numeric_limits<double>::quiet_NaN();
std::chrono::time_point<std::chrono::system_clock> start_time_;