When to use SCOPED_REALTIME_CHECK in Tracktion?

I see the “SCOPED_REALTIME_CHECK” macro in the applyToBuffer callback of most plugins in the engine. But I’m really not sure how to make sense of it, and whether or not I should replicate this when creating my own plugins. I looked at the definition, but I have to say it’s pretty cryptic to me.

No, you can largely ignore that. It’s just an internal debugging tool we run to ensure parts of the audio engine don’t take a large amount of time and to log which bits do we get dropouts.


I see, thank you. It does sound like an interesting tool though, if there’s ever any documentation on how to use that, I’d be interested.

You’d just add a SCOPED_REALTIME_CHECK at the start of a function you wanted to measure and then define TRACKTION_CHECK_FOR_SLOW_RENDERING=1 in the Projucer module configuration or as a preprocessor definition.

If those functions then take more than 1.5ms to complete that line will get logged to the console so you can see the time-consuming functions.

1 Like