OpenTTD
framerate_type.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9 
37 #ifndef FRAMERATE_TYPE_H
38 #define FRAMERATE_TYPE_H
39 
40 #include "stdafx.h"
41 #include "core/enum_type.hpp"
42 
50  PFE_FIRST = 0,
64 };
66 
67 
68 typedef uint64 TimingMeasurement;
69 
78  PerformanceElement elem;
79  TimingMeasurement start_time;
80 public:
81  PerformanceMeasurer(PerformanceElement elem);
82  ~PerformanceMeasurer();
83  void SetExpectedRate(double rate);
84  static void Paused(PerformanceElement elem);
85 };
86 
99  PerformanceElement elem;
100  TimingMeasurement start_time;
101 public:
104  static void Reset(PerformanceElement elem);
105 };
106 
107 void ShowFramerateWindow();
108 
109 #endif /* FRAMERATE_TYPE_H */
Time spent processing cargo movement.
PerformanceElement
Elements of game performance that can be measured.
End of enum, must be last.
RAII class for measuring simple elements of performance.
PerformanceAccumulator(PerformanceElement elem)
Begin measuring one block of the accumulating value.
Speed of drawing world and GUI.
Time spent processing aircraft.
static void Reset(PerformanceElement elem)
Store the previous accumulator value and reset for a new cycle of accumulating measurements.
Type (helpers) for enums.
Speed of gameloop processing.
Time spend processing road vehicles.
Definition of base types and functions in a cross-platform compatible way.
Time spent processing other world features.
uint64 TimingMeasurement
Type used to hold a performance timing measurement.
Time spent processing ships.
Time spent drawing world viewports in GUI.
Speed of painting drawn video buffer.
RAII class for measuring multi-step elements of performance.
~PerformanceAccumulator()
Finish and add one block of the accumulating value.
void ShowFramerateWindow()
Open the general framerate window.
#define DECLARE_POSTFIX_INCREMENT(type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:16
Time spent processing trains.
Time spent waiting for link graph background jobs.
Speed of mixing audio samples.