EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
EBGeometry::SimpleTimer Class Reference

Simple timer class used for local performance profiling. More...

#include <EBGeometry_SimpleTimer.hpp>

Public Types

using Clock = std::chrono::steady_clock
 Clock alias.
 
using TimePoint = Clock::time_point
 Time point alias.
 

Public Member Functions

 SimpleTimer () noexcept
 Constructor. Immediately calls start() followed by stop() to initialise both time points to the current instant, leaving the timer in a valid state with approximately zero elapsed time.
 
 ~SimpleTimer () noexcept=default
 Destructor.
 
void start () noexcept
 Start timing.
 
void stop () noexcept
 Stop timing.
 
double seconds () const noexcept
 Compute the elapsed time between the last start() and stop() calls.
 

Protected Attributes

TimePoint m_start
 Start time point.
 
TimePoint m_stop
 Stop time point.
 

Detailed Description

Simple timer class used for local performance profiling.

Member Function Documentation

◆ seconds()

double EBGeometry::SimpleTimer::seconds ( ) const
inlinenoexcept

Compute the elapsed time between the last start() and stop() calls.

Returns
Elapsed time in seconds as a double.

◆ start()

void EBGeometry::SimpleTimer::start ( )
inlinenoexcept

Start timing.

Note
Calling this resets timers that are already running.

The documentation for this class was generated from the following file: