MayaFlux 0.3.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 90 of file Clock.cpp.

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