Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在C编程中,我们可以使用#pragma预处理器指令启用/禁用循环优化。
在哪种情况下,应该关闭循环优化?
当您为调试进行编译时,默认情况下优化是关闭的(以便调试器中的源代码行与正在执行的代码完全匹配)。
您只会在非常特定的情况下使用编译指示,例如:
您会发现导致未定义行为的优化限制/错误(每个 C 程序员都应该知道的关于未定义行为的知识(感谢@R)
您需要准确的实时计时