-
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
-
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
-
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);