Overhead associated with OutputDebugString in release build

后端 未结 8 1859
有刺的猬
有刺的猬 2020-12-15 05:26

Is there a significant overhead associated with calling OutputDebugString in release build?

8条回答
  •  -上瘾入骨i
    2020-12-15 06:00

    Why not measure it yourself? Compile the following code, run it & time it. Then remove the call to OutputDebugString, recompile and rerun. Should take abut three minutes of you time.

       #include 
    
        int main() {
            const int COUNT = 1000000;
            int z = 0;    
            for ( unsigned int i = 0; i < COUNT; i++ ) {
                z += i;
                OutputDebugString( "foo" );
            }
            return z;
        }
    

提交回复
热议问题