Skip to content

Commit 56c4864

Browse files
committed
Fix clock difference
1 parent 711aaaf commit 56c4864

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/MockClientImpl.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class MockClientImpl : public ClientImpl {
4141

4242
SyncOpResult createProducer(const std::string& topic) {
4343
using namespace std::chrono;
44-
auto start = std::chrono::high_resolution_clock::now();
44+
auto start = high_resolution_clock::now();
4545
std::promise<SyncOpResult> promise;
4646
createProducerAsync(topic, {}, [&start, &promise](Result result, Producer) {
47-
auto timeMs = duration_cast<std::chrono::milliseconds>(steady_clock::now() - start).count();
47+
auto timeMs = duration_cast<milliseconds>(high_resolution_clock::now() - start).count();
4848
promise.set_value({result, timeMs});
4949
});
5050
return promise.get_future().get();
@@ -55,7 +55,7 @@ class MockClientImpl : public ClientImpl {
5555
auto start = std::chrono::high_resolution_clock::now();
5656
std::promise<SyncOpResult> promise;
5757
subscribeAsync(topic, "sub", {}, [&start, &promise](Result result, Consumer) {
58-
auto timeMs = duration_cast<std::chrono::milliseconds>(steady_clock::now() - start).count();
58+
auto timeMs = duration_cast<milliseconds>(high_resolution_clock::now() - start).count();
5959
promise.set_value({result, timeMs});
6060
});
6161
return promise.get_future().get();

0 commit comments

Comments
 (0)