Skip to content
Snippets Groups Projects
Commit dca0136e authored by Martin Killenberg's avatar Martin Killenberg
Browse files

Fixed PeriodicTrigger, which was not sleeping at all.

parent 5106c47d
No related branches found
No related tags found
No related merge requests found
......@@ -26,13 +26,16 @@ namespace ChimeraTK {
void mainLoop() {
tick = 0;
if(timeout = 0) timeout = defaultTimeout_;
std::chrono::time_point<std::chrono::steady_clock> t = std::chrono::steady_clock::now();
while(true) {
timeout.read();
t += static_cast<uint32_t>(timeout) * std::chrono::milliseconds();
if(timeout == 0){
// set receiving end of timeout. Will only be overwritten if there is new data.
timeout = defaultTimeout_;
}
t += std::chrono::milliseconds(static_cast<uint32_t>(timeout));
boost::this_thread::interruption_point();
std::this_thread::sleep_until(t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment