74{
75
77 return;
80 return;
81 }
84 return;
85 }
86 const auto now_ms = [] {
87 return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
88 };
89 const char* const fn = __FUNCTION__;
91 PrebuildQueue::Slice slice;
92 {
93 ScopeGuard in_slice([
this] {
m_in_slice =
false; });
94 slice =
m_queue.run_slice(slice_ms, now_ms, input_pending, [fn](
const std::string& name,
long long ms) {
95 BOOST_LOG_TRIVIAL(debug) << fn << ": " << name << ": unit took " << ms << " ms";
96 });
97 }
98 if (slice.completed)
99 BOOST_LOG_TRIVIAL(info) << fn << ": task complete: " << slice.name << ", " << slice.units << " unit(s) in " << slice.ms << " ms this slice";
100 else
101 BOOST_LOG_TRIVIAL(debug) << fn << ": " << slice.name << ": " << slice.units << " unit(s) in " << slice.ms << " ms, yielding";
102 if (!slice.remaining)
106 else
107 m_timer.StartOnce(next_slice_ms);
108}
void start()
Definition IdleScheduler.cpp:62
void stop()
Definition IdleScheduler.cpp:68
bool m_in_slice
Definition IdleScheduler.hpp:40
bool input_pending()
Definition IdleScheduler.cpp:37
bool yielding()
Definition IdleScheduler.cpp:49