Game Development Community

Console method for timing / profiling?

by Joe O · in iTorque 2D · 04/02/2012 (8:09 am) · 0 replies

I'm looking for a function that does something like this:

function MyObject::doSomething( %this, %foo ) {
  startTiming( "stringKey1" );
  // do some work
  endTiming( "stringKey1" );
}

function MyObject::debug( %this ) {
  echo("timing: " @ getTiming( "stringKey1" ) );
}

I could write one but if one exists in the platform, even better!