Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::BaseProfiler< T > Class Template Reference

Profiler class to measure the elapsed time. More...

#include <duckdb.hpp>

Collaboration diagram for duckdb::BaseProfiler< T >:

Public Member Functions

void Start ()
 Start the timer.
 
void End ()
 End the timer.
 
void Reset ()
 Reset the timer.
 
double Elapsed () const
 
idx_t ElapsedNanos () const
 

Private Member Functions

time_point< T > Tick () const
 Current time point.
 

Private Attributes

time_point< T > start
 Start time point.
 
time_point< T > end
 End time point.
 
bool finished = false
 True, if end End() been called.
 
bool ran = false
 True, if the timer was ran.
 

Detailed Description

template<typename T>
class duckdb::BaseProfiler< T >

Profiler class to measure the elapsed time.

Member Function Documentation

◆ Start()

template<typename T >
void duckdb::BaseProfiler< T >::Start ( )
inline

Start the timer.

35907 {
35908 finished = false;
35909 ran = true;
35910 start = Tick();
35911 }
time_point< T > start
Start time point.
Definition duckdb.hpp:35949
time_point< T > Tick() const
Current time point.
Definition duckdb.hpp:35945
bool ran
True, if the timer was ran.
Definition duckdb.hpp:35955
bool finished
True, if end End() been called.
Definition duckdb.hpp:35953
Here is the call graph for this function:

◆ End()

template<typename T >
void duckdb::BaseProfiler< T >::End ( )
inline

End the timer.

35913 {
35914 end = Tick();
35915 finished = true;
35916 }
time_point< T > end
End time point.
Definition duckdb.hpp:35951
Here is the call graph for this function:

◆ Reset()

template<typename T >
void duckdb::BaseProfiler< T >::Reset ( )
inline

Reset the timer.

35918 {
35919 finished = false;
35920 ran = false;
35921 }

◆ Elapsed()

template<typename T >
double duckdb::BaseProfiler< T >::Elapsed ( ) const
inline

Returns the elapsed time in seconds. If ran is false, it returns 0. If End() has been called, it returns the total elapsed time, otherwise, returns how far along the timer is right now.

35927 {
35928 if (!ran) {
35929 return 0;
35930 }
35931 auto measured_end = finished ? end : Tick();
35932 return std::chrono::duration_cast<std::chrono::duration<double>>(measured_end - start).count();
35933 }
Here is the call graph for this function:

◆ ElapsedNanos()

template<typename T >
idx_t duckdb::BaseProfiler< T >::ElapsedNanos ( ) const
inline
35935 {
35936 if (!ran) {
35937 return 0;
35938 }
35939 auto measured_end = finished ? end : Tick();
35940 return static_cast<idx_t>(std::chrono::duration_cast<std::chrono::nanoseconds>(measured_end - start).count());
35941 }

◆ Tick()

template<typename T >
time_point< T > duckdb::BaseProfiler< T >::Tick ( ) const
inlineprivate

Current time point.

35945 {
35946 return T::now();
35947 }
Here is the caller graph for this function:

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