Today, when I wrote the code, I suddenly wanted to know the running time of the program, so I included the time header file in the code. The include file is not marked red, but it appears in the
CLOCKS_PER_SECBut the place marked in red shows undefined identifier
I thought, this is not right. Isn’t it defined in the time file? How can it be undefined, but I see the prompt above. It turns out that
CLOCKS_PER_SECIs an integer quantity, the value is 1000, then I might as well define myself. So I define the macro at the top of the code, there is no red mark, and the running result of the program is the same as that in Visual Studio 2019, so there should be no problem.
In addition, originally my code was the same at the beginning
#include<time.h>If I go back to visual studio code after solving the same problem in Visual Studio 2019, it will not be marked in red, just display the identifier
CLOCKS_PER_SECUndefined, do not know why, first record it.
This article is about how to display clocks when visual studio code runs C + + code_ PER_ This is the article about the problems not defined by SEC. More about visual studio code running C + + to display clocks_ PER_ SEC undefined content, please search the previous articles of developer or continue to browse the related articles below. I hope you can support developer more in the future!