Verified Commit a9428258 authored by Pavel Doležal's avatar Pavel Doležal
Browse files

Time: Fix timestamp subtraction

parent d9493527
Pipeline #73353 passed with stage
in 2 minutes and 56 seconds
......@@ -148,7 +148,7 @@ namespace DDP {
friend Time operator-(Time first, const Time& second)
{
if(first.m_timespec.tv_nsec - second.m_timespec.tv_nsec < 0) {
first.m_timespec.tv_sec -= second.m_timespec.tv_sec - 1;
first.m_timespec.tv_sec = first.m_timespec.tv_sec - second.m_timespec.tv_sec - 1;
first.m_timespec.tv_nsec = first.m_timespec.tv_nsec + 1000000000 - second.m_timespec.tv_nsec;
}
else {
......
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