In GitLab by @mariusalexander on May 10, 2023, 07:36
It would be nice to have a simple macro that can be used to profile a piece of code (i.e. measure the time elapsed). It could log on Trace level by default.
It's usage could look something like this:
void myFancyFunction()
{
GT_LOG_PROFILE();
gtDebug() << "some message!";
// do expensive stuff here
return 0;
}
/* OUT:
> [DEBUG] [...] some message!
> [TRACE] [...] [Profile] myFancyFunction@line_no: took xy ms
*/
In GitLab by @mariusalexander on May 10, 2023, 07:36
It would be nice to have a simple macro that can be used to profile a piece of code (i.e. measure the time elapsed). It could log on
Trace
level by default.It's usage could look something like this: