Share via

Why does a simple code work very long for me and others normally

Alex 0 Reputation points
2023-07-14T20:49:40.5733333+00:00

Hi I have visual studio 2022, max updated, I have a problem I compile the code takes from 5 to 10 seconds in C++, the code is very simple hello world, why so long, if the second time to run then it is instantaneous but if you change hello world to hello world2 then again 5-10 seconds CPU is not loaded that I in the settings natikal or what prrblomom
This text is output in visual studio console or I don't know how to call it correctly Assembly started...

1>------ Build started: Project: Project3, Configuration: Debug x64 ------

1>FileName.cpp

1>Project3.vcxproj -> C:\Users\User\source\reposition\Project3\x64\Debug\Project3.exe

========== Build: successfully completed - 1 , failed - 0, up to date - 0, skipped - 0 ==========

========== Build started at 11:47 PM, took 00,970 s ==========

Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.


1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,191 Reputation points Microsoft External Staff
    2023-07-17T04:56:34.2366667+00:00

    Hi @Alex, 

    Welcome to Microsoft Q&A! 

    Please disable or uninstall the installed extensions under Extensions > Manage Extensions > Installed.

    Meanwhile, go to Tools > Options > Environment > General > uncheck Automatically adjust visual experience based on client performance and Use hardware graphics acceleration if available. 

    Then, you can build again and check if the time is shorter. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.