11 if (message->content_case() == data::Message::ContentCase::kEcho)
13 auto now = std::chrono::high_resolution_clock::now();
14 return std::chrono::duration_cast<std::chrono::nanoseconds>(now -
_start);
24 std::chrono::duration<double, std::milli> response =
GetResponse();
25 return response.count();
double GetResponseInMilliseconds()
Translate the precise response to a floating point number of milliseconds.
Exception class thrown by all library classes.
std::chrono::nanoseconds GetResponse()
Get the response value. Will throw an exception if called before the response is received.
virtual std::chrono::nanoseconds ExtractResponse(const Node *node, const data::Message *message) override
Called when a response for the original message has been received.
Represents a Node the Endpoint knows about and can send messages to.
std::chrono::time_point< std::chrono::high_resolution_clock > _start
When the ping request was sent.