Re: Measure Performance via QueryPerformanceCounter [message #41712] |
Mon, 22 November 2004 07:11 |
supaey2000
Messages: 2 Registered: November 2004
|
Junior Member |
|
|
Thank you Ken and David for your help.
The PROFILER procedure was what I was looking for and I will use it in
future.
The resolution of Systime (/seconds) was not accurate enough to allow
measurements of the required time for 5 or 6 IDL commands within one
procedure.
The QueryPerformanceCounter still helped me for this.
It worked quite good with the C-Code Library IDL_Tools from Randall
Frank for IDL 5.6 (http://www.kilvarock.com/freesoftware/dlms/randallfrank.htm),
since Call_External can't handle "normal" paramters.
I give an short example for someone who needs to call kernel32.dll
functions.
err = EXTPROC_DEFINE('QueryPerformanceCounter','kernel32.dll','Que ryPerformanceCounter','l(p)')
err = EXTPROC_DEFINE('QueryPerformanceFrequency','kernel32.dll','Q ueryPerformanceFrequency','l(p)')
a=[0ll]
b=[0ll]
c=[0ll]
ret=QueryPerformanceFrequency(a)
ret=QueryPerformanceCounter(b)
for i=0,10 do print, 'Performance Test'
ret=QueryPerformanceCounter(c)
print, 'Time required: ' + strtrim(string((c-b)/double(a)),2) + '
Seconds'
Thank you,
Daniel
|
|
|
|
Re: Measure Performance via QueryPerformanceCounter [message #41722 is a reply to message #41720] |
Sat, 20 November 2004 07:20  |
KM
Messages: 29 Registered: October 2004
|
Junior Member |
|
|
On Sat, 19 Nov 2004, Daniel wrote:
> I have a small prgramm with some loops, but still the programm is
> to slow. So I would like to measure which loops take how long. I
> was thinking of measuring via with help of the
> QueryPerformanceCounter API like
>
> result=call_external('kernel32.dll','QueryPerformanceCounter ',/l64_value)
>
> but I only get an constant value as return. Has anybody used this
> API before an how would the correct call_external command look
> like.
Are your loops and program in IDL on in the DLL? It looks like you
might be using the DLL just for performance checking? If so, you
might want to stay in IDL instead and look at the PROFILER
procedure.
-k.
|
|
|