Results 1 to 3 of 3

Thread: Performance - Timer

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2004
    Posts
    60

    Performance - Timer

    I wish to assess the speed performance of some C++ code, thus enabling me to establish what the 'bottlenecks' are in the system.

    Can anybody advise me on the best way to do this? I am not too familiar with C++ but I am thinking of inserting get system time commands into the code. Each of these commands will assign the time values to variables, or an array. After which i will then be able to do some calculations and assess the times of each section.

    What is the most accurate command to use to get the system time?

    Will the get system time commands affect the speed of the code too much?

    Thank You

  2. #2
    Junior Member
    Join Date
    Feb 2005
    Posts
    31

    Re: Performance - Timer

    C++.Net? And besides, this is a C# forum- there are plenty of C++ forums elsewhere. This probable isn't the place to look for a non .net question.

    with .Net, you can use
    Code:
    DateTime.Now.TimeOfDay.ToString()
    Dan

  3. #3
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: Performance - Timer

    Do you mean this?

    Code:
      [DllImport("kernel32")]
      private static extern bool QueryPerformanceFrequency(ref long PerformanceFrequency);
      [DllImport("kernel32")]
      private static extern bool QueryPerformanceCounter(ref long PerformanceCount);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width