Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv4832
Modified Files:
Benchmark.cpp Benchmark-xZIP.cpp Package.cpp
Log Message:
Time measured up to microseconds.
Index: Package.cpp
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Package.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Package.cpp 15 Feb 2007 18:56:29 -0000 1.10
--- Package.cpp 7 May 2007 20:06:15 -0000 1.11
***************
*** 394,399 ****
int r;
std::string info;
! time_t beg;
! time_t end;
char tmp[128];
--- 394,398 ----
int r;
std::string info;
! double end;
char tmp[128];
***************
*** 406,414 ****
Name());
! beg=system->Time();
r=make();
if (r) {
! end=system->Time();
! sprintf(tmp, "%f", (double) (end-beg));
lastBuildTime=tmp;
std::cout << "Build time : " << lastBuildTime << std::endl;
--- 405,413 ----
Name());
! system->startTimer();
r=make();
if (r) {
! end=system->endTimer();
! sprintf(tmp, "%f", end);
lastBuildTime=tmp;
std::cout << "Build time : " << lastBuildTime << std::endl;
Index: Benchmark-xZIP.cpp
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark-xZIP.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Benchmark-xZIP.cpp 17 Apr 2007 18:15:11 -0000 1.2
--- Benchmark-xZIP.cpp 7 May 2007 20:06:15 -0000 1.3
***************
*** 49,54 ****
std::string BenchmarkxZIP::bench(void)
{
! time_t start = System()->Time();
! time_t end;
std::string cmd;
std::string result;
--- 49,53 ----
std::string BenchmarkxZIP::bench(void)
{
! double end;
std::string cmd;
std::string result;
***************
*** 64,70 ****
cmd+="c Compbenchmarks.dat > /dev/null";
if (System()->exec(cmd, sstdout)==0) {
! end=System()->Time();
! sprintf(dum, "%0.0f", ((float)package->totalSize())/((int)(end-start)));
result=dum;
return(result);
--- 63,70 ----
cmd+="c Compbenchmarks.dat > /dev/null";
+ System()->startTimer();
if (System()->exec(cmd, sstdout)==0) {
! end=System()->endTimer();
! sprintf(dum, "%0.0f", ((double)package->totalSize())/(end));
result=dum;
return(result);
Index: Benchmark.cpp
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Benchmark.cpp 17 Apr 2007 18:15:11 -0000 1.6
--- Benchmark.cpp 7 May 2007 20:06:15 -0000 1.7
***************
*** 66,71 ****
std::string r;
std::string info;
! time_t beg;
! time_t end;
char tmp[128];
--- 66,70 ----
std::string r;
std::string info;
! double end;
char tmp[128];
***************
*** 84,94 ****
! beg=System()->Time();
r=bench();
Package()->System()->Chomp(r);
if (r!="0") {
! end=System()->Time();
! sprintf(tmp, "%f", (double) (end-beg));
lastExecutionTime=tmp;
Package()->storeStatus(Package::Benchmarked);
--- 83,93 ----
! System()->startTimer();
r=bench();
Package()->System()->Chomp(r);
if (r!="0") {
! end=System()->endTimer();
! sprintf(tmp, "%f", end);
lastExecutionTime=tmp;
Package()->storeStatus(Package::Benchmarked);
|