Nektar++
Public Types | Public Member Functions | Private Attributes | List of all members
Nektar::LibUtilities::Timer Class Reference

#include <Timer.h>

Public Types

using Clock = std::chrono::steady_clock
 
using CounterType = Clock::time_point
 
using Seconds = std::chrono::duration< NekDouble >
 

Public Member Functions

 Timer ()=default
 
 ~Timer ()=default
 
 Timer (const Timer &rhs)=delete
 
Timeroperator= (const Timer &rhs)=delete
 
void Start ()
 
void Stop ()
 
Seconds Elapsed ()
 
NekDouble TimePerTest (unsigned int n)
 Returns amount of seconds per iteration in a test with n iterations. More...
 

Private Attributes

CounterType m_start
 
CounterType m_end
 

Detailed Description

Definition at line 49 of file Timer.h.

Member Typedef Documentation

◆ Clock

using Nektar::LibUtilities::Timer::Clock = std::chrono::steady_clock

Definition at line 52 of file Timer.h.

◆ CounterType

using Nektar::LibUtilities::Timer::CounterType = Clock::time_point

Definition at line 53 of file Timer.h.

◆ Seconds

using Nektar::LibUtilities::Timer::Seconds = std::chrono::duration<NekDouble>

Definition at line 54 of file Timer.h.

Constructor & Destructor Documentation

◆ Timer() [1/2]

Nektar::LibUtilities::Timer::Timer ( )
default

◆ ~Timer()

Nektar::LibUtilities::Timer::~Timer ( )
default

◆ Timer() [2/2]

Nektar::LibUtilities::Timer::Timer ( const Timer rhs)
delete

Member Function Documentation

◆ Elapsed()

Timer::Seconds Nektar::LibUtilities::Timer::Elapsed ( )

Definition at line 52 of file Timer.cpp.

53 {
54  return std::chrono::duration_cast<Seconds>(m_end - m_start);
55 }
CounterType m_start
Definition: Timer.h:72

References m_end, and m_start.

Referenced by TimePerTest().

◆ operator=()

Timer& Nektar::LibUtilities::Timer::operator= ( const Timer rhs)
delete

◆ Start()

void Nektar::LibUtilities::Timer::Start ( )

◆ Stop()

void Nektar::LibUtilities::Timer::Stop ( )

◆ TimePerTest()

NekDouble Nektar::LibUtilities::Timer::TimePerTest ( unsigned int  n)

Returns amount of seconds per iteration in a test with n iterations.

Definition at line 57 of file Timer.cpp.

58 {
59  return Elapsed().count() / static_cast<NekDouble>(n);
60 }
double NekDouble

References Elapsed().

Referenced by Nektar::SolverUtils::DriverSteadyState::ConvergenceHistory(), Nektar::SolverUtils::CouplingCwipi::DumpRawFields(), Nektar::LibUtilities::Interpreter::ExpressionEvaluator::Evaluate(), Nektar::LibUtilities::Interpreter::ExpressionEvaluator::EvaluateAtPoint(), Nektar::SolverUtils::CouplingCwipi::ExtrapolateFields(), main(), Nektar::Utilities::ProcessVarOpti::Process(), Nektar::FieldUtils::InputXml::Process(), Nektar::FieldUtils::ProcessCreateExp::Process(), Nektar::FieldUtils::ProcessIsoContour::Process(), Nektar::SolverUtils::CouplingCwipi::ReceiveCwipi(), Nektar::SolverUtils::CouplingCwipi::ReceiveStart(), RunModule(), Nektar::SolverUtils::CouplingCwipi::SendComplete(), Nektar::CoupledLinearNS::SetUpCoupledMatrix(), Nektar::Collections::CollectionOptimisation::SetWithTimings(), Nektar::CoupledLinearNS::SolveSteadyNavierStokes(), Nektar::SolverUtils::UnsteadySystem::v_DoSolve(), Nektar::MMFAdvection::v_DoSolve(), Nektar::MMFMaxwell::v_DoSolve(), Nektar::PulseWaveSystem::v_DoSolve(), Nektar::MMFSWE::v_DoSolve(), Nektar::CoupledLinearNS::v_DoSolve(), Nektar::Dummy::v_PostIntegrate(), and Nektar::SolverUtils::CouplingCwipi::v_Send().

Member Data Documentation

◆ m_end

CounterType Nektar::LibUtilities::Timer::m_end
private

Definition at line 73 of file Timer.h.

Referenced by Elapsed(), and Stop().

◆ m_start

CounterType Nektar::LibUtilities::Timer::m_start
private

Definition at line 72 of file Timer.h.

Referenced by Elapsed(), and Start().