Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Profiling vb script

Reply
 
Old 12-18-2008   #1 (permalink)
sarah.ilyas


 
 

Profiling vb script

Hello,

I need to calculate the execution time of every function that runs in
my vbscript. I cant change the code of the scripts. I need to get the
time of the functions when they are executed. Is there a way i can
hook the script engine and whenever a function call is made i simply
record the time? I did search an Active script profiler interface. Can
it be used? If yes can someone please guide me how.

Any help would be much appreciated.

Thanks

My System SpecsSystem Spec
Old 12-19-2008   #2 (permalink)
Rahisuddin Shah


 
 

Re: Profiling vb script

Hi Sarah,
I have searched a lot for the same but no luck so far.
If you something please let me know also. I appreciate it.
dprw2006@xxxxxx
thanks
--
Rahisuddin Shah
MCSE - MCSA - ITIL
<sarah.ilyas@xxxxxx> wrote in message
news:b2d7b2cc-0363-46bb-8938-e016bf6d9f93@xxxxxx
Quote:

> Hello,
>
> I need to calculate the execution time of every function that runs in
> my vbscript. I cant change the code of the scripts. I need to get the
> time of the functions when they are executed. Is there a way i can
> hook the script engine and whenever a function call is made i simply
> record the time? I did search an Active script profiler interface. Can
> it be used? If yes can someone please guide me how.
>
> Any help would be much appreciated.
>
> Thanks

My System SpecsSystem Spec
Old 12-20-2008   #3 (permalink)
mr_unreliable


 
 

Re: Profiling vb script



sarah.ilyas@xxxxxx wrote:
Quote:

> I need to calculate the execution time of every function that runs in
> my vbscript. I cant change the code of the scripts. I need to get the
> time of the functions when they are executed.
hi Sarah,

How fussy are you about the timings???

If a stopwatch is good enough, you could run your script
under the control of the "Microsoft Script Editor", which
has debugging capabilities. More specifically, you could
run your script one statement at a time, and then use a
stopwatch (or other timer) to time each step.

If you have any recent version of microsoft office, then
you will have the microsoft script editor. Look for
"MSE.EXE" or "MSE7.EXE".

There are other script debuggers out there. You may be
already using one. If you have a generous software budget,
then Sapien's PrimalScript is generally considered best-of-
breed (also the most expensive of the breed).

If that's not good enough, you may be able to rig up
something using the microsoft script control. The script
control allows you to feed it a script, and will run it
for you. You could program up a mini-app to feed the
script control one statement at-a-time, and time each
step with a high-resolution timer. (There are several
high-resolution timers available as actX controls, which
could be used from script, or any com-enabled language).

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)
My System SpecsSystem Spec
Old 12-20-2008   #4 (permalink)
Jim de Graff


 
 

Re: Profiling vb script

Since you don't have access to the functions then I suggest you write a
"timing" function. Get the value of Timer immediately before a function
call, then call the timing function immediately after the functions you are
profiling. In order to minimize the amount of time spent in the timing
routine, this routine could just add a new entry to a dictionary object on
each call. I suggest something like

set dic = CreateObject("Scripting.Dictionary")

start = Timer
call FOO(arg1,arg2)
Timing dic,start,"FOO"

Function Timing ( dictionary , start , function )
dictionary(Now() & " " & Timer & " " & function) = Timer - start
End Function

Print out the dictionary at the end of the program run to display the timing
statistics.

<sarah.ilyas@xxxxxx> wrote in message
news:b2d7b2cc-0363-46bb-8938-e016bf6d9f93@xxxxxx
Quote:

> Hello,
>
> I need to calculate the execution time of every function that runs in
> my vbscript. I cant change the code of the scripts. I need to get the
> time of the functions when they are executed. Is there a way i can
> hook the script engine and whenever a function call is made i simply
> record the time? I did search an Active script profiler interface. Can
> it be used? If yes can someone please guide me how.
>
> Any help would be much appreciated.
>
> Thanks

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Logon Script Causing Laptops To Hang - Problems in script? VB Script
problem passing args to script 'There is no script engine for file extenstion' VB Script
Include another script, keep variables in included script? PowerShell
Script file has 'OS Handle' error when run from script PowerShell
Can you drag-n-drop a file on top of a PS script to run the script? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46