holoscan::get_current_time_us
holoscan::get_current_time_us
Return the current time in microseconds since the epoch.
This function previously used the C++11 standard library’s chrono library. This function now uses CLOCK_REALTIME to get the current time, because the clock chrono uses is implementation-dependent. We want a known clock like CLOCK_REALTIME so that we can use the clock across machines. CLOCK_REALTIME is a clock that is supposed to be synchronized with PTP synchronization.
Returns: The current time in microseconds returned by CLOCK_REALTIME. If CLOCK_REALTIME is not available, it returns -1.