Update src/Common/Throttler.cpp

Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
This commit is contained in:
alesapin 2021-06-02 23:02:08 +03:00 committed by GitHub
parent 4a1bf51ad1
commit 7030828d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ void Throttler::add(size_t amount)
if (max_speed && current_speed > max_speed)
{
/// If we was too fast then we have to sleep util our smoothed speed became <= max_speed
/// If we was too fast then we have to sleep until our smoothed speed became <= max_speed
int64_t sleep_time = -window_ns * std::log2(max_speed / current_speed);
if (sleep_time > 0)