ratio.cc Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ratio.cc
Go to the documentation of this file.
1 /* ratio.cc
2 */
3 #include "osl/stat/ratio.h"
4 #include <iostream>
5
6 osl::stat::Ratio::~Ratio()
7 {
8 if (name && ave.numElements()
9 && (show_on_destructor
10 #ifdef SHOW_RATIO
11 || 1
12 #endif
13 ))
14 {
15 show();
16 }
17 }
18
19 void osl::stat::Ratio::show() const
20 {
21 std::cerr << name << " " << 100.0*ratio()
22 << " " << static_cast<int>(ave.numElements() * ratio())
23 << " / " << ave.numElements() << "\n";
24 }
25
26 /* ------------------------------------------------------------------------- */
27 // ;;; Local Variables:
28 // ;;; mode:c++
29 // ;;; c-basic-offset:2
30 // ;;; End: