Game Development Community

using the profiler?

by Matthew Franklin · in Torque Game Engine · 09/30/2002 (11:36 pm) · 2 replies

This is going to come across as a stupid question, but how do I enable the profiler and dump its results? It seems like I should be able to just profilerEnable and profilerDumpToFile, but the console says it can't find those functions. What's the trick?

#1
10/01/2002 (1:02 pm)
Quick notes on the profiler:

You need to enable the profiler by setting a #define in platform/profiler.h ; it's up at the top of the file.

PROFILE_BEGIN(...)

PROFILE_END(...)

These are macros which demarcate profiling sections. They MUST be matched or you'll get no output. You may need to have multiple ENDs for a BEGIN (for instance, if you return in the middle of a function).

Hope this helps!
#2
10/01/2002 (1:47 pm)
the profiler in Torque is a tiny bit broken...you have to enable the profiler code with a macro -

in engine/platform/profiler.h you can just do a #define ENABLE_PROFILER - also, the TORQUE_SUPPORTS_VC_INLINE_X86_ASM macro needs to be defined in order to have the time gathering code enabled.

then the console functions will work... I'm going to fix all this up in the main codebase sometime, but until then, these fixes should make it work for ya.