mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Implement frame timestamps and use wpi::Now() for generation.
This commit is contained in:
@@ -32,6 +32,16 @@ SourceImpl::~SourceImpl() {
|
||||
// Everything else can clean up itself.
|
||||
}
|
||||
|
||||
uint64_t SourceImpl::GetCurFrameTime() {
|
||||
std::unique_lock<std::mutex> lock{m_frameMutex};
|
||||
return m_frame.time();
|
||||
}
|
||||
|
||||
Frame SourceImpl::GetCurFrame() {
|
||||
std::unique_lock<std::mutex> lock{m_frameMutex};
|
||||
return m_frame;
|
||||
}
|
||||
|
||||
Frame SourceImpl::GetNextFrame() {
|
||||
std::unique_lock<std::mutex> lock{m_frameMutex};
|
||||
// TODO: handle spurious wakeup by comparing frame timestamps
|
||||
|
||||
Reference in New Issue
Block a user