MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / GetNextWait

Method GetNextWait

IntelPresentMon/Core/source/kernel/Overlay.cpp:605–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

603 tickDuration_ = 1s / double(tickRate);
604 }
605 Overlay::TaskScheduler::nano Overlay::TaskScheduler::GetNextWait()
606 {
607 // reset all zeros
608 for (auto&&[r, p] : vi::zip(remainings_, periods_)) {
609 if (r == 0) r = p;
610 }
611 // find the lowest remaining
612 const auto min = *rn::min_element(remainings_);
613 // step all by lowest
614 for (auto& r : remainings_) {
615 r -= min;
616 }
617 // return step duration
618 return std::chrono::duration_cast<std::chrono::nanoseconds>(tickDuration_) * min;
619 }
620 bool Overlay::TaskScheduler::AtPoll() const
621 {
622 return remainings_[Poll_] == 0;

Callers 1

RunTickMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected