comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Measure Performance via QueryPerformanceCounter
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Measure Performance via QueryPerformanceCounter [message #41712] Mon, 22 November 2004 07:11
supaey2000 is currently offline  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 #41720 is a reply to message #41712] Sat, 20 November 2004 14:59 Go to previous message
dszlucha@gmail.com is currently offline  dszlucha@gmail.com
Messages: 3
Registered: November 2004
Junior Member
Daniel -

To measure elapsed time in IDL try:

start = SYSTIME(/SECONDS)

<code to time here>

elapsed_time = SYSTIME(/SECONDS) - start

Also, a win32 function that I've used to ckeck elapsed time is
timeGetTime() (result = CALL_EXTERNAL('kernel32.dll', 'timeGetTime',
/L64_VALUE))

David
Re: Measure Performance via QueryPerformanceCounter [message #41722 is a reply to message #41720] Sat, 20 November 2004 07:20 Go to previous message
KM is currently offline  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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: announcing GDL 0.8.6 (was: GDL 0.8.6 is out)
Next Topic: Draw Widgets

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:14:07 PDT 2025

Total time taken to generate the page: 0.00516 seconds