mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-22 23:26:34 +00:00
(svn r10069) -Documentation: some documentation for TIC/TOC, as it isn't what I expected...
This commit is contained in:
parent
5b972a1d58
commit
d3a7fb8d73
22
src/debug.h
22
src/debug.h
@ -93,7 +93,27 @@ const char *GetDebugString();
|
|||||||
#define OTTD_PRINTF64 "ll"
|
#define OTTD_PRINTF64 "ll"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Used for profiling */
|
/* Used for profiling
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* TIC();
|
||||||
|
* --Do your code--
|
||||||
|
* TOC("A name", 1);
|
||||||
|
*
|
||||||
|
* When you run the TIC() / TOC() multiple times, you can increase the '1'
|
||||||
|
* to only display average stats every N values. Some things to know:
|
||||||
|
*
|
||||||
|
* for (int i = 0; i < 5; i++) {
|
||||||
|
* TIC();
|
||||||
|
* --Do yuor code--
|
||||||
|
* TOC("A name", 5);
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* Is the correct usage for multiple TIC() / TOC() calls.
|
||||||
|
*
|
||||||
|
* TIC() / TOC() creates it's own block, so make sure not the mangle
|
||||||
|
* it with an other block.
|
||||||
|
**/
|
||||||
#define TIC() {\
|
#define TIC() {\
|
||||||
extern uint64 _rdtsc();\
|
extern uint64 _rdtsc();\
|
||||||
uint64 _xxx_ = _rdtsc();\
|
uint64 _xxx_ = _rdtsc();\
|
||||||
|
Loading…
Reference in New Issue
Block a user