AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
autopas::utils::TraceTimer Class Reference

A wrapper around autopas::utils::Timer that only compiles implementation logic if the SPDLOG_ACTIVE_LEVEL is set to TRACE. More...

#include <TraceTimer.h>

Public Member Functions

void start ()
 start the timer.
 
long stop ()
 Stops the timer and returns the time elapsed in nanoseconds since the last call to start.
 
void reset ()
 Resets the timer to 0.
 
void addTime (long nanoseconds)
 Adds the given amount of nanoseconds to the total time.
 
long getTotalTime () const
 Get total accumulated time.
 

Detailed Description

A wrapper around autopas::utils::Timer that only compiles implementation logic if the SPDLOG_ACTIVE_LEVEL is set to TRACE.

For a higher log level, functions are empty and will be removed by the compiler.

Member Function Documentation

◆ addTime()

void autopas::utils::TraceTimer::addTime ( long  nanoseconds)
inline

Adds the given amount of nanoseconds to the total time.

Parameters
nanoseconds

◆ getTotalTime()

long autopas::utils::TraceTimer::getTotalTime ( ) const
inline

Get total accumulated time.

Returns
Total time in nano seconds.

◆ reset()

void autopas::utils::TraceTimer::reset ( )
inline

Resets the timer to 0.

◆ start()

void autopas::utils::TraceTimer::start ( )
inline

start the timer.

◆ stop()

long autopas::utils::TraceTimer::stop ( )
inline

Stops the timer and returns the time elapsed in nanoseconds since the last call to start.

It also adds the duration to the total time.

Returns
elapsed time in nanoseconds

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