C ++ 6.0 profiler test function execution time

Source: Internet
Author: User

[Use command line mode for profile]

[Example of "helloworld"]

1. First Open Your Workspace:

2. Select your project-> Settings...

3. Click Select link and check enable profiling. Press OK to complete the settings.

4. Select build-> "build" or "rebuild all" to build your workspace

5. After the build is complete, click build-> profile... the following dialog box is displayed:

6. Click function timing to show the time it takes for each function worker row.

7. Press OK to close the hosts window and start the profiling operation.

8. After profiling is completed, the results of the profile will be listed in the following response window:

9. For more detail, please read msdn reference:

Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/vccore98/html/_ core_run_the_profiler_from_the_development_environment.asp

10. The following is the result of printing the profile of 100 and 1000 helloworld (two functions) separately:

Profile: function timing, sorted by Time
Date: Fri Sep 30 23:55:17 2005
Program statistics
------------------
Command Line at 2005 Sep 30 23: 55: "D:/project/helloworld/debug/helloworld"
Total time: 2166.598 milliseconds
Time outside of functions: 0.563 millisecond
Call depth: 2
Total functions: 3
Total hits: 3
Function coverage 100.0%
Overhead calculated 4
Overhead average 4
Module statistics for helloworld.exe
------------------------------------
Time in module: 2166.034 millisecond
Percent of time in model: 100.0%
Functions in module: 3
Hits In module: 3
Module function coverage: 100.0%
Func + child hit
Time % time % count function
-------------------------------------------------------------
1725.777 79.7 1725.777 79.7 1 print1000hello (void) (main. OBJ)
440.255 20.3 440.255 20.3 1 print100hello (void) (main. OBJ)
0.002 0.0 2166.034 100.0 1 _ main (main. OBJ)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.