1 #ifndef PERFORMANCESTATS_H
2 #define PERFORMANCESTATS_H
5 * Copyright (C) 2005-2008 Team XBMC
8 * This Program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This Program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with XBMC; see the file COPYING. If not, write to
20 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21 * http://www.gnu.org/copyleft/gpl.html
27 #include "PlatformDefs.h"
28 #include "CriticalSection.h"
30 class PerformanceCounter
38 PerformanceCounter(double dTime
=0.0, double dUser
=0.0, double dSys
=0.0, __int64 nSamples
=1LL) :
39 m_time(dTime
), m_user(dUser
), m_sys(dSys
), m_samples(nSamples
) { }
40 virtual ~PerformanceCounter() { }
45 class CPerformanceStats
{
48 virtual ~CPerformanceStats();
50 void AddSample(const std::string
&strStatName
, const PerformanceCounter
&perf
);
51 void AddSample(const std::string
&strStatName
, double dTime
);
55 CCriticalSection m_lock
;
56 std::map
<std::string
, PerformanceCounter
*> m_mapStats
;