MayaFlux 1.0.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 93 of file Clock.cpp.

94{
95 auto now = std::chrono::steady_clock::now();
96 auto until_next = m_next_frame_time - now;
97
98 if (until_next.count() < 0) {
99 return std::chrono::nanoseconds(0);
100 }
101
102 return std::chrono::duration_cast<std::chrono::nanoseconds>(until_next);
103}
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: