Contains common functions related to time measurement.
More...
#include <chrono>
#include <stddef.h>
#include <type_traits>
Go to the source code of this file.
Contains common functions related to time measurement.
◆ timePoint
Abstract definition of a time point
◆ 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] | end | The end time point (tf) |
| [in] | start | The 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] | end | The end time point (tf) |
| [in] | start | The 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] | end | The end time point (tf) |
| [in] | start | The start time point (t0) |
- Returns
- A 64-bit precision floating point number with the difference in seconds between the two time points