LMMS
Loading...
Searching...
No Matches
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
31namespace lmms
32{
33
34
40{
41public:
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);
53private:
54 clock_t m_real;
55 clock_t m_user;
56 clock_t m_system;
57};
58
64{
65 public:
66 PerfLogTimer(const QString& name);
68
69 void begin();
70 void end();
71
72 private:
73 QString name;
75};
76
77
78} // namespace lmms
79
80#endif // LMMS_PERFLOG_H
QString name
Definition PerfLog.h:73
void end()
Definition PerfLog.cpp:119
PerfLogTimer(const QString &name)
Definition PerfLog.cpp:103
void begin()
Definition PerfLog.cpp:114
PerfTime begin_time
Definition PerfLog.h:74
~PerfLogTimer()
Definition PerfLog.cpp:109
CPU time point.
Definition PerfLog.h:40
clock_t real() const
Definition PerfLog.cpp:48
clock_t m_system
Definition PerfLog.h:56
clock_t user() const
Definition PerfLog.cpp:53
friend PerfTime operator-(const PerfTime &lhs, const PerfTime &rhs)
Definition PerfLog.cpp:94
PerfTime()
Definition PerfLog.cpp:43
clock_t system() const
Definition PerfLog.cpp:58
static PerfTime now()
Definition PerfLog.cpp:68
static clock_t ticksPerSecond()
Definition PerfLog.cpp:81
bool valid() const
Definition PerfLog.cpp:63
clock_t m_user
Definition PerfLog.h:55
clock_t m_real
Definition PerfLog.h:54
Definition AudioAlsa.cpp:35