3 ms·
Not that this at all answers your question, and I'm guessing you know this already, but for a language with a preprocessor, that should be something more like:
by PaulDavisThe1st 6y ago
Not that this at all answers your question, and I'm guessing you know this already, but for a language with a preprocessor, that should be something more like:
#ifndef NDEBUG
#define DEBUG(msg) if (debug) { log (msg); }
#else
#define DEBUG(msg)
#endif
this eliminates any question of branch cost from an NDEBUG ("production" or "optimized") build, and you don't have to wonder.
Obviously there are more sophisticated methods too.