diff options
author | truelight <truelight@openttd.org> | 2007-06-08 18:23:26 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-06-08 18:23:26 +0000 |
commit | f4c1938af90e7daa612b6169b1b988547d4012ff (patch) | |
tree | ac2c39ec53efe4c89869b7aa953fa85bb3a8ffa9 | |
parent | 1e1154b08c035f10602a0a7617725cfce7d3ac88 (diff) | |
download | openttd-f4c1938af90e7daa612b6169b1b988547d4012ff.tar.xz |
(svn r10069) -Documentation: some documentation for TIC/TOC, as it isn't what I expected...
-rw-r--r-- | src/debug.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/debug.h b/src/debug.h index faac0c09f..c84ec7f46 100644 --- a/src/debug.h +++ b/src/debug.h @@ -93,7 +93,27 @@ const char *GetDebugString(); #define OTTD_PRINTF64 "ll" #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() {\ extern uint64 _rdtsc();\ uint64 _xxx_ = _rdtsc();\ |