source: trunk/poppler/mypoppler/poppler/ProfileData.cc @ 2

Last change on this file since 2 was 2, checked in by Eugene Romanenko, 15 years ago

First import

File size: 845 bytes
Line 
1//========================================================================
2//
3// ProfileData.cc
4//
5// Copyright 2005 Jonathan Blandford <jrb@gnome.org>
6//
7//========================================================================
8
9#include <config.h>
10
11#ifdef USE_GCC_PRAGMAS
12#pragma implementation
13#endif
14
15#include <stdlib.h>
16#include <stddef.h>
17#include "ProfileData.h"
18
19//------------------------------------------------------------------------
20// ProfileData
21//------------------------------------------------------------------------
22
23ProfileData::ProfileData() {
24        count = 0;
25        total = 0.0;
26        min = 0.0;
27        max = 0.0;
28}
29
30void
31ProfileData::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;
40        }
41        total += elapsed;
42        count ++;
43}
44
Note: See TracBrowser for help on using the repository browser.