12#ifndef LLVM_EXPONENTIALBACKOFF_H
13#define LLVM_EXPONENTIALBACKOFF_H
35 using duration = std::chrono::steady_clock::duration;
36 using time_point = std::chrono::steady_clock::time_point;
45 duration MinWait = std::chrono::milliseconds(10),
46 duration MaxWait = std::chrono::milliseconds(500))
47 : MinWait(MinWait), MaxWait(MaxWait),
48 EndTime(
std::chrono::steady_clock::
now() + Timeout) {}
59 std::random_device RandDev;
60 int64_t CurrentMultiplier = 1;
static sys::TimePoint< std::chrono::seconds > now(bool Deterministic)
A class to help implement exponential backoff.
bool waitForNextAttempt()
Blocks while waiting for the next attempt.
std::chrono::steady_clock::duration duration
ExponentialBackoff(duration Timeout, duration MinWait=std::chrono::milliseconds(10), duration MaxWait=std::chrono::milliseconds(500))
std::chrono::steady_clock::time_point time_point
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.