Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

abktimer.cxx File Reference

#include <stdio.h>
#include <iomanip>
#include <limits.h>
#include "abkassert.h"
#include "abktimer.h"
#include "abkcpunorm.h"

Include dependency graph for abktimer.cxx:

Include dependency graph

Go to the source code of this file.

Functions

ostream & operator<< (ostream &os, const Timer &tm)


Function Documentation

ostream& operator<< std::ostream &  os,
const Timer tm
 

Definition at line 326 of file abktimer.cxx.

References CPUNormalizer::getNormalizingFactor(), Timer::getRealTime(), Timer::getSysTime(), and Timer::getUserTime().

00327 {
00328 #if defined(sun) || defined(WIN32) || defined(linux)
00329     CPUNormalizer cpunorm;
00330     double userSec=tm.getUserTime(),
00331            normSec=tm.getUserTime() * cpunorm.getNormalizingFactor();
00332     char   buffer[20];
00333     if (userSec>0.01) 
00334     {
00335        double frac =userSec-floor(userSec);
00336        double delta=frac-0.001*floor(frac*1000.0);
00337        userSec-=delta;
00338               frac =normSec-floor(normSec); 
00339               delta=frac-0.001*floor(frac*1000);
00340        normSec-=delta;
00341     }
00342   
00343 
00344     sprintf(buffer,"%.1e",tm.getSysTime());
00345     
00346     os << " " << userSec <<" user,"
00347        << " " << buffer <<" system," 
00348        << " " << tm.getRealTime() <<" real," 
00349        << " " << normSec << " norm'd "
00350        << "sec ";
00351 #else
00352     if (tm.getRealTime()>(INT_MAX+0.0)/CLOCKS_PER_SEC)
00353        os << tm.getRealTime() << " real sec";
00354     else
00355        os << " " << tm.getUserTime() << " user sec, "
00356                  << tm.getRealTime() << " real sec";
00357 #endif
00358     return os;
00359 }

Here is the call graph for this function:


Generated on Mon Apr 25 01:10:07 2005 for Parquete by doxygen 1.3.2