summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/latency/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/Ice/latency/Client.cpp')
-rw-r--r--cpp/demo/Ice/latency/Client.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/cpp/demo/Ice/latency/Client.cpp b/cpp/demo/Ice/latency/Client.cpp
index 0e304efdedb..14dbf3de6c5 100644
--- a/cpp/demo/Ice/latency/Client.cpp
+++ b/cpp/demo/Ice/latency/Client.cpp
@@ -36,7 +36,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
// Initial ping to setup the connection.
ping->ice_ping();
- IceUtil::Time tsec = IceUtil::Time::now();
+ IceUtil::Time tm = IceUtil::Time::now();
const int repetitions = 100000;
cout << "pinging server " << repetitions << " times (this may take a while)" << endl;
@@ -45,12 +45,10 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
ping->ice_ping();
}
- tsec = IceUtil::Time::now() - tsec;
+ tm = IceUtil::Time::now() - tm;
- double tmsec = tsec * 1000.0L;
-
- cout << "time for " << repetitions << " pings: " << tmsec << "ms" << endl;
- cout << "time per ping: " << tmsec / repetitions << "ms" << endl;
+ cout << "time for " << repetitions << " pings: " << tm.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "time per ping: " << tm.toMicroSeconds() / 1000.0 / repetitions << "ms" << endl;
return EXIT_SUCCESS;
}