summaryrefslogtreecommitdiff
path: root/cpp/demo
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2004-10-06 17:53:00 +0000
committerMarc Laukien <marc@zeroc.com>2004-10-06 17:53:00 +0000
commit7dc2a0cec8c09723ea9efc241c01db678dfdc73f (patch)
tree42d788203c8a701f52ed0babe099db564eb2d4ce /cpp/demo
parentfixes (diff)
downloadice-7dc2a0cec8c09723ea9efc241c01db678dfdc73f.tar.bz2
ice-7dc2a0cec8c09723ea9efc241c01db678dfdc73f.tar.xz
ice-7dc2a0cec8c09723ea9efc241c01db678dfdc73f.zip
time changes
Diffstat (limited to 'cpp/demo')
-rw-r--r--cpp/demo/Freeze/backup/Client.cpp2
-rw-r--r--cpp/demo/Freeze/bench/Client.cpp78
-rw-r--r--cpp/demo/Ice/latency/Client.cpp4
-rw-r--r--cpp/demo/Ice/throughput/Client.cpp4
4 files changed, 43 insertions, 45 deletions
diff --git a/cpp/demo/Freeze/backup/Client.cpp b/cpp/demo/Freeze/backup/Client.cpp
index 8616b5baf73..aba5a002bab 100644
--- a/cpp/demo/Freeze/backup/Client.cpp
+++ b/cpp/demo/Freeze/backup/Client.cpp
@@ -27,8 +27,6 @@ testFailed(const char* expr, const char* file, unsigned int line)
#define test(ex) ((ex) ? ((void)0) : testFailed(#ex, __FILE__, __LINE__))
-
-
int
main(int argc, char* argv[])
{
diff --git a/cpp/demo/Freeze/bench/Client.cpp b/cpp/demo/Freeze/bench/Client.cpp
index 60e4a675add..19d57a514a9 100644
--- a/cpp/demo/Freeze/bench/Client.cpp
+++ b/cpp/demo/Freeze/bench/Client.cpp
@@ -179,8 +179,8 @@ private:
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord * 1000 << "ms" << endl;
//
// Read each record.
@@ -195,8 +195,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reads: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord * 1000 << "ms" << endl;
//
// Optional index sub-test
@@ -218,8 +218,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord * 1000 << "ms" << endl;
}
@@ -239,9 +239,9 @@ private:
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / reads;
- cout << "\ttime for " << reads << " reads of " << gen->toString() << " records: "
- << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << reads << " reads of " << gen->toString() << " records: " << total * 1000 << "ms"
+ << endl;
+ cout << "\ttime per read: " << perRecord * 1000 << "ms" << endl;
generatedReadWithIndex(m, reads, gen);
}
@@ -282,8 +282,8 @@ private:
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord * 1000 << "ms" << endl;
//
// Read each record.
@@ -301,8 +301,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reads: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord * 1000 << "ms" << endl;
//
// Optional index test
@@ -325,8 +325,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord * 1000 << "ms" << endl;
}
@@ -363,8 +363,8 @@ private:
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord * 1000 << "ms" << endl;
//
// Read each record.
@@ -382,8 +382,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reads: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord * 1000 << "ms" << endl;
//
// Optional index test
@@ -407,8 +407,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord * 1000 << "ms" << endl;
}
void IntIntMapReadIndexTest(IntIntMap&)
@@ -438,8 +438,8 @@ private:
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord * 1000 << "ms" << endl;
//
// Do some read tests.
@@ -469,8 +469,8 @@ private:
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord * 1000 << "ms" << endl;
*/
}
@@ -505,9 +505,9 @@ TestApp::IntIntMapIndexTest(IndexedIntIntMap& m)
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reverse (indexed) reads: " << total.toMicroSeconds() / 1000.0 << "ms"
+ cout << "\ttime for " << _repetitions << " reverse (indexed) reads: " << total * 1000 << "ms"
<< endl;
- cout << "\ttime per reverse read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime per reverse read: " << perRecord * 1000 << "ms" << endl;
}
void
@@ -525,8 +525,8 @@ TestApp::generatedReadWithIndex(IndexedIntIntMap& m, int reads, const GeneratorP
IceUtil::Time perRecord = total / reads;
cout << "\ttime for " << reads << " reverse (indexed) reads of " << gen->toString() << " records: "
- << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per reverse read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ << total * 1000 << "ms" << endl;
+ cout << "\ttime per reverse read: " << perRecord * 1000 << "ms" << endl;
}
@@ -559,8 +559,8 @@ TestApp::Struct1Struct2MapIndexTest(IndexedStruct1Struct2Map& m)
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / (2 *_repetitions);
- cout << "\ttime for " << 2 *_repetitions << " indexed reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per indexed read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << 2 *_repetitions << " indexed reads: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per indexed read: " << perRecord * 1000 << "ms" << endl;
}
void
@@ -582,8 +582,8 @@ TestApp::Struct1Class1MapIndexTest(IndexedStruct1Class1Map& m)
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " indexed reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per indexed read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " indexed reads: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per indexed read: " << perRecord * 1000 << "ms" << endl;
}
@@ -627,8 +627,8 @@ TestApp::Struct1ObjectMapTest()
IceUtil::Time total = _watch.stop();
IceUtil::Time perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " writes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per write: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " writes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per write: " << perRecord * 1000 << "ms" << endl;
//
// Read each record.
@@ -661,8 +661,8 @@ TestApp::Struct1ObjectMapTest()
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " reads: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per read: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " reads: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per read: " << perRecord * 1000 << "ms" << endl;
//
// Remove each record.
@@ -680,8 +680,8 @@ TestApp::Struct1ObjectMapTest()
total = _watch.stop();
perRecord = total / _repetitions;
- cout << "\ttime for " << _repetitions << " removes: " << total.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "\ttime per remove: " << perRecord.toMicroSeconds() / 1000.0 << "ms" << endl;
+ cout << "\ttime for " << _repetitions << " removes: " << total * 1000 << "ms" << endl;
+ cout << "\ttime per remove: " << perRecord * 1000 << "ms" << endl;
}
class MyFactory : public Ice::ObjectFactory
diff --git a/cpp/demo/Ice/latency/Client.cpp b/cpp/demo/Ice/latency/Client.cpp
index 14dbf3de6c5..1c807e04784 100644
--- a/cpp/demo/Ice/latency/Client.cpp
+++ b/cpp/demo/Ice/latency/Client.cpp
@@ -47,8 +47,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
tm = IceUtil::Time::now() - tm;
- cout << "time for " << repetitions << " pings: " << tm.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "time per ping: " << tm.toMicroSeconds() / 1000.0 / repetitions << "ms" << endl;
+ cout << "time for " << repetitions << " pings: " << tm * 1000 << "ms" << endl;
+ cout << "time per ping: " << tm * 1000 / repetitions << "ms" << endl;
return EXIT_SUCCESS;
}
diff --git a/cpp/demo/Ice/throughput/Client.cpp b/cpp/demo/Ice/throughput/Client.cpp
index 03e10c4ea1f..29715304863 100644
--- a/cpp/demo/Ice/throughput/Client.cpp
+++ b/cpp/demo/Ice/throughput/Client.cpp
@@ -128,8 +128,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
tm = IceUtil::Time::now() - tm;
- cout << "time for " << repetitions << " sequences: " << tm.toMicroSeconds() / 1000.0 << "ms" << endl;
- cout << "time per sequence: " << tm.toMicroSeconds() / 1000.0 / repetitions << "ms" << endl;
+ cout << "time for " << repetitions << " sequences: " << tm * 1000 << "ms" << endl;
+ cout << "time per sequence: " << tm * 1000 / repetitions << "ms" << endl;
double mbit = repetitions * seqSize * 8.0 / tm.toMicroSeconds();
if(c == 'e')
{