File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 2323
2424#include " cachelib/cachebench/runner/Runner.h"
2525#include " cachelib/cachebench/runner/Stressor.h"
26+ #include " cachelib/cachebench/util/Sleep.h"
2627#include " cachelib/common/Utils.h"
2728
2829#ifdef CACHEBENCH_FB_ENV
@@ -123,6 +124,7 @@ int main(int argc, char** argv) {
123124 using namespace facebook ::cachelib;
124125 using namespace facebook ::cachelib::cachebench;
125126
127+ calibrateSleep ();
126128#ifdef CACHEBENCH_FB_ENV
127129 facebook::initFacebook (&argc, &argv);
128130 if (!checkArgsValidity ()) {
Original file line number Diff line number Diff line change 3636#include " cachelib/cachebench/util/Exceptions.h"
3737#include " cachelib/cachebench/util/Parallel.h"
3838#include " cachelib/cachebench/util/Request.h"
39+ #include " cachelib/cachebench/util/Sleep.h"
3940#include " cachelib/cachebench/workload/GeneratorBase.h"
4041
4142namespace facebook {
@@ -418,7 +419,7 @@ class AsyncCacheStressor : public Stressor {
418419 auto throttleFn = [&] {
419420 if (needDelay && ++opCounter == opDelayBatch) {
420421 opCounter = 0 ;
421- std::this_thread::sleep_for (opDelay);
422+ highPrecisionSleep (opDelay);
422423 }
423424 // Limit the rate if specified.
424425 limitRate ();
Original file line number Diff line number Diff line change 3535#include " cachelib/cachebench/util/Exceptions.h"
3636#include " cachelib/cachebench/util/Parallel.h"
3737#include " cachelib/cachebench/util/Request.h"
38+ #include " cachelib/cachebench/util/Sleep.h"
3839#include " cachelib/cachebench/workload/GeneratorBase.h"
3940
4041namespace facebook {
@@ -229,7 +230,7 @@ class CacheStressor : public CacheStressorBase {
229230 auto throttleFn = [&] {
230231 if (needDelay && ++opCounter == opDelayBatch) {
231232 opCounter = 0 ;
232- std::this_thread::sleep_for (opDelay);
233+ highPrecisionSleep (opDelay);
233234 }
234235 // Limit the rate if specified.
235236 limitRate ();
You can’t perform that action at this time.
0 commit comments