lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
PerfLog.h
Go to the documentation of this file.
1
/*
2
* PerfLog.h - Small performance logger
3
*
4
* Copyright (c) 2017-2018 LMMS Developers
5
*
6
* This file is part of LMMS - https://lmms.io
7
*
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
12
*
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 GNU
16
* General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public
19
* License along with this program (see COPYING); if not, write to the
20
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301 USA.
22
*
23
*/
24
25
#ifndef LMMS_PERFLOG_H
26
#define LMMS_PERFLOG_H
27
28
#include <ctime>
29
#include <QString>
30
31
namespace
lmms
32
{
33
34
39
class
PerfTime
40
{
41
public
:
42
PerfTime
();
43
bool
valid
()
const
;
44
45
clock_t
real
()
const
;
46
clock_t
user
()
const
;
47
clock_t
system
()
const
;
48
49
static
PerfTime
now
();
50
static
clock_t
ticksPerSecond
();
51
52
friend
PerfTime
operator-
(
const
PerfTime
& lhs,
const
PerfTime
& rhs);
53
private
:
54
clock_t
m_real
;
55
clock_t
m_user
;
56
clock_t
m_system
;
57
};
58
63
class
PerfLogTimer
64
{
65
public
:
66
PerfLogTimer
(
const
QString&
name
);
67
~PerfLogTimer
();
68
69
void
begin
();
70
void
end
();
71
72
private
:
73
QString
name
;
74
PerfTime
begin_time
;
75
};
76
77
78
}
// namespace lmms
79
80
#endif
// LMMS_PERFLOG_H
lmms::PerfLogTimer::name
QString name
Definition
PerfLog.h:73
lmms::PerfLogTimer::end
void end()
Definition
PerfLog.cpp:119
lmms::PerfLogTimer::PerfLogTimer
PerfLogTimer(const QString &name)
Definition
PerfLog.cpp:103
lmms::PerfLogTimer::begin
void begin()
Definition
PerfLog.cpp:114
lmms::PerfLogTimer::begin_time
PerfTime begin_time
Definition
PerfLog.h:74
lmms::PerfTime
CPU time point.
Definition
PerfLog.h:40
lmms::PerfTime::real
clock_t real() const
Definition
PerfLog.cpp:48
lmms::PerfTime::m_system
clock_t m_system
Definition
PerfLog.h:56
lmms::PerfTime::user
clock_t user() const
Definition
PerfLog.cpp:53
lmms::PerfTime::operator-
friend PerfTime operator-(const PerfTime &lhs, const PerfTime &rhs)
Definition
PerfLog.cpp:94
lmms::PerfTime::PerfTime
PerfTime()
Definition
PerfLog.cpp:43
lmms::PerfTime::system
clock_t system() const
Definition
PerfLog.cpp:58
lmms::PerfTime::now
static PerfTime now()
Definition
PerfLog.cpp:68
lmms::PerfTime::ticksPerSecond
static clock_t ticksPerSecond()
Definition
PerfLog.cpp:81
lmms::PerfTime::valid
bool valid() const
Definition
PerfLog.cpp:63
lmms::PerfTime::m_user
clock_t m_user
Definition
PerfLog.h:55
lmms::PerfTime::m_real
clock_t m_real
Definition
PerfLog.h:54
lmms
Definition
RemotePluginBase.cpp:34
Generated on
for lmms by
1.18.0