MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ time_until_next_frame()

std::chrono::nanoseconds MayaFlux::Vruta::FrameClock::time_until_next_frame ( ) const

Get time until next frame should occur.

Returns
Duration to sleep, or zero if already past next frame time

Definition at line 89 of file Clock.cpp.

90{
91 auto now = std::chrono::steady_clock::now();
92 auto until_next = m_next_frame_time - now;
93
94 if (until_next.count() < 0) {
95 return std::chrono::nanoseconds(0);
96 }
97
98 return std::chrono::duration_cast<std::chrono::nanoseconds>(until_next);
99}
std::chrono::steady_clock::time_point m_next_frame_time
Definition Clock.hpp:284

References m_next_frame_time.

Referenced by wait_for_next_frame().

+ Here is the caller graph for this function: