beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / poppler / ProfileData.cc
bloba0c44747a56c3c19e597009a3b1fa2c9c58c542a
1 //========================================================================
2 //
3 // ProfileData.cc
4 //
5 // Copyright 2005 Jonathan Blandford <jrb@gnome.org>
6 //
7 //========================================================================
9 #include <config.h>
11 #ifdef USE_GCC_PRAGMAS
12 #pragma implementation
13 #endif
15 #include <stdlib.h>
16 #include <stddef.h>
17 #include "ProfileData.h"
19 //------------------------------------------------------------------------
20 // ProfileData
21 //------------------------------------------------------------------------
23 ProfileData::ProfileData() {
24 count = 0;
25 total = 0.0;
26 min = 0.0;
27 max = 0.0;
30 void
31 ProfileData::addElement (double elapsed) {
32 if (count == 0) {
33 min = elapsed;
34 max = elapsed;
35 } else {
36 if (elapsed < min)
37 min = elapsed;
38 if (elapsed > max)
39 max = elapsed;
41 total += elapsed;
42 count ++;