ProfileData.cc 783 Bytes
Newer Older
1 2 3 4 5
//========================================================================
//
// ProfileData.cc
//
// Copyright 2005 Jonathan Blandford <jrb@gnome.org>
6
// Copyright 2018 Adam Reichold <adam.reichold@t-online.de>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
//
//========================================================================

#include <config.h>

#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif

#include "ProfileData.h"

//------------------------------------------------------------------------
// ProfileData
//------------------------------------------------------------------------

void
ProfileData::addElement (double elapsed) {
	if (count == 0) {
		min = elapsed;
		max = elapsed;
	} else {
		if (elapsed < min)
			min = elapsed;
		if (elapsed > max)
			max = elapsed;
	}
	total += elapsed;
	count ++;
}