Commit 20160fd1 authored by yannick legoc's avatar yannick legoc

Changed order of sleep in VEXPController

parent 864fe964
...@@ -562,14 +562,14 @@ void VEXPController::periodicUpdate() { ...@@ -562,14 +562,14 @@ void VEXPController::periodicUpdate() {
while (m_running.load()) { while (m_running.load()) {
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::seconds(spyPeriod()));
std::lock_guard<std::mutex> lock(m_publisherMutex); std::lock_guard<std::mutex> lock(m_publisherMutex);
// Send using the publisher. // Send using the publisher.
string spyData = getSpyData(); string spyData = getSpyData();
m_spyPublisher->send(spyData); m_spyPublisher->send(spyData);
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::seconds(spyPeriod()));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment