Skip to content

Commit

Permalink
Eliminate modulo operation from elapsed time computation.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Apr 2, 2019
1 parent 62adc17 commit 4640e39
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mythtv/programs/mythbackend/scheduler.cpp
Expand Up @@ -2128,11 +2128,8 @@ void Scheduler::run(void)
statuschanged = true;
startIter = m_reclist.begin();
}
int elapsed = t.elapsed();
int seconds = elapsed / 1000;
if (elapsed % 1000) // round up
seconds++;
schedRunTime = max(static_cast<int>(seconds * 1.5 + 2),
int elapsed = (t.elapsed() + 999) / 1000;
schedRunTime = max(static_cast<int>(elapsed * 1.5 + 2),
schedRunTime);
}

Expand Down

0 comments on commit 4640e39

Please sign in to comment.