jaffarCommon
Loading...
Searching...
No Matches
Typedefs | Functions
timing.hpp File Reference

Contains common functions related to time measurement. More...

#include <chrono>
#include <stddef.h>
#include <type_traits>
Include dependency graph for timing.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef std::chrono::high_resolution_clock::time_point jaffarCommon::timing::timePoint
 

Functions

__JAFFAR_COMMON__INLINE__ timePoint jaffarCommon::timing::now ()
 
__JAFFAR_COMMON__INLINE__ double jaffarCommon::timing::timeDeltaSeconds (const std::chrono::time_point< std::chrono::high_resolution_clock > end, const std::chrono::time_point< std::chrono::high_resolution_clock > start)
 
__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::timing::timeDeltaNanoseconds (const std::chrono::time_point< std::chrono::high_resolution_clock > end, const std::chrono::time_point< std::chrono::high_resolution_clock > start)
 
__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::timing::timeDeltaMicroseconds (const std::chrono::time_point< std::chrono::high_resolution_clock > end, const std::chrono::time_point< std::chrono::high_resolution_clock > start)
 

Detailed Description

Contains common functions related to time measurement.

Typedef Documentation

◆ timePoint

typedef std::chrono::high_resolution_clock::time_point jaffarCommon::timing::timePoint

Abstract definition of a time point

Function Documentation

◆ now()

__JAFFAR_COMMON__INLINE__ timePoint jaffarCommon::timing::now ( )

Gets the current time point as per a high resolution clock

Returns
The current high resolution time point

◆ timeDeltaMicroseconds()

__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::timing::timeDeltaMicroseconds ( const std::chrono::time_point< std::chrono::high_resolution_clock >  end,
const std::chrono::time_point< std::chrono::high_resolution_clock >  start 
)

Calculates the difference in microseconds between two given time points (tf - t0), using a high resolution clock

Parameters
[in]endThe end time point (tf)
[in]startThe start time point (t0)
Returns
A 64-bit unsigned integer with the microseconds difference between the time points

◆ timeDeltaNanoseconds()

__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::timing::timeDeltaNanoseconds ( const std::chrono::time_point< std::chrono::high_resolution_clock >  end,
const std::chrono::time_point< std::chrono::high_resolution_clock >  start 
)

Calculates the difference in nanoseconds between two given time points (tf - t0), using a high resolution clock

Parameters
[in]endThe end time point (tf)
[in]startThe start time point (t0)
Returns
A 64-bit unsigned integer with the nanoseconds difference between the time points

◆ timeDeltaSeconds()

__JAFFAR_COMMON__INLINE__ double jaffarCommon::timing::timeDeltaSeconds ( const std::chrono::time_point< std::chrono::high_resolution_clock >  end,
const std::chrono::time_point< std::chrono::high_resolution_clock >  start 
)

Calculates the difference in seconds between two given time points (tf - t0), using a high resolution clock

Parameters
[in]endThe end time point (tf)
[in]startThe start time point (t0)
Returns
A 64-bit precision floating point number with the difference in seconds between the two time points