ratio.cc
Go to the documentation of this file.
00001 /* ratio.cc
00002  */
00003 #include "osl/stat/ratio.h"
00004 #include <iostream>
00005 
00006 osl::stat::Ratio::~Ratio()
00007 {
00008   if (name && ave.numElements()
00009       && (show_on_destructor
00010 #ifdef SHOW_RATIO
00011           || 1
00012 #endif
00013         ))
00014   {
00015     show();
00016   }
00017 }
00018 
00019 void osl::stat::Ratio::show() const
00020 {
00021   std::cerr << name << " " << 100.0*ratio() 
00022             << " " << static_cast<int>(ave.numElements() * ratio())
00023             << " / " << ave.numElements() << "\n";
00024 }
00025 
00026 /* ------------------------------------------------------------------------- */
00027 // ;;; Local Variables:
00028 // ;;; mode:c++
00029 // ;;; c-basic-offset:2
00030 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines