File: Profiler.h

package info (click to toggle)
pinball 0.3.20201218-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 8,452 kB
  • sloc: cpp: 15,230; makefile: 840; sh: 381; xml: 24
file content (52 lines) | stat: -rw-r--r-- 1,143 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/***************************************************************************
                          Profiler.h  -  description
                             -------------------
    begin                : Tue Jul 30 2001
    copyright            : (C) 2002 by Henrik Enqvist
    email                : henqvist@excite.com
 ***************************************************************************/


#ifndef PROFILER_H
#define PROFILER_H


#define COUNT 1
#define ALIGN 2
#define BEH 3
#define GLIGHT 4
#define COLLISION 5
#define PLIGHT 6
#define PNORMAL 7
#define RENDER 8
#define SOUND 9
#define SIG 10
#define TRANS 11
#define DRAW 13
#define SWAP 14
#define KEY 15
#define RENDER_OUT 16
#define TICK_OUT 17
#define SWAP_OUT 18
#define WAIT 19


/** Singleton class for quick and dirty profiling */
class Profiler {
 protected:
	Profiler();
 public:
	~Profiler();
	static Profiler* getInstance();
	void startProfile(int i);
	void stopProfile();
	void printProfile();
 private:
	unsigned int m_aProfile[256];
	unsigned int m_iStart;
	unsigned int m_iCurrentProfile;
	unsigned int m_iCurrentTime;
	static Profiler* p_Profiler;
};

#endif