Skip to content

Commit

Permalink
Don't peg the CPU in SlowCounter::Process_()
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Aug 27, 2024
1 parent 6eec6a8 commit 81c61a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/components/SlowCounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class SlowCounter final : public Component
std::chrono::duration<double, std::micro> elapsedMs;
do
{
std::this_thread::yield();
elapsedMs = std::chrono::high_resolution_clock::now() - start;
} while ( elapsedMs.count() < _waitMs );

Expand Down

0 comments on commit 81c61a0

Please sign in to comment.