From a89df27c0f7ded0a673dc84ce0b0e24c6d05e0d0 Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 18 Jul 2003 04:35:30 +0000 Subject: misc changes git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@103 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- bench.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'bench.cpp') diff --git a/bench.cpp b/bench.cpp index 8670d37..82f8446 100644 --- a/bench.cpp +++ b/bench.cpp @@ -87,11 +87,11 @@ static const byte *const key=(byte *)"0123456789abcdefghijklmnopqrstuvwxyzABCDEF static double logtotal = 0; static unsigned int logcount = 0; -void OutputResultBytes(const char *name, unsigned long length, double timeTaken) +void OutputResultBytes(const char *name, double length, double timeTaken) { double mbs = length / timeTaken / (1024*1024); cout << "" << name; - cout << "" << length; + cout << "" << setprecision(3) << length / (1024*1024); cout << setiosflags(ios::fixed); cout << "" << setprecision(3) << timeTaken; cout << "" << setprecision(3) << mbs << endl; @@ -120,18 +120,18 @@ void BenchMark(const char *name, BlockTransformation &cipher, double timeTotal) const int nBlocks = BUF_SIZE / cipher.BlockSize(); clock_t start = clock(); - unsigned long i=0, length=BUF_SIZE; + unsigned long i=0, blocks=1; double timeTaken; do { - length *= 2; - for (; i" << endl; - cout << "AlgorithmBytes ProcessedTime TakenMegabytes(2^20 bytes)/Second\n" << endl; + cout << "AlgorithmMegabytes(2^20 bytes) ProcessedTime TakenMB/Second\n" << endl; BenchMarkKeyless("CRC-32", t); BenchMarkKeyless("Adler-32", t); -- cgit v1.2.1