![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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. 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||