64 void AddSample(
float fRequestTime,
float fHostTime);
94 std::vector<Sample> mSamples;
One answer of the host.
Definition clocksynctask.h:30
float mOffset
Definition clocksynctask.h:45
float mRoundTrip
Definition clocksynctask.h:44
bool operator<(const Sample &other) const
Report whether this answer has a smaller offset than another, the order of the median.
Definition clocksynctask.h:40
Task of a guest that measures the clock of the host.
Definition clocksynctask.h:15
void OnStart() override
Forget the answers, and ask at the next poll.
void OnPoll() override
Ask the host for the time every kRequestInterval polls.
~ClockSyncTask() override=default
Destroy the object.
static constexpr int kSampleCount
The answers the task waits for.
Definition clocksynctask.h:52
void AddSample(float fRequestTime, float fHostTime)
Note an answer of the host while the task runs, and finish once the answers suffice.
void FinishSync()
Finish the task and give JoinpadRT the median offset and the mean round trip.
static constexpr int kRequestInterval
The polls between two requests.
Definition clocksynctask.h:49
Task()
Construct an idle task.
Definition task.h:24