Jump to content

Recommended Posts

Hello again,

I'm having some issues with WinWait. What I want to do is make some kind of benchmark where I can time how long programs take to open.

It works great with Word(2010) but not with Excel(2010). I've tried this little bit of code to look up the handle using the PID but that doesn't seem to work and I'm wondering if anyone can help me understand how to look this up.

Thank you, I'm feeling like I've got a long ways to go but I'm psyched.

I'm slightly embarrassed about this bit of code...

Local $begin = TimerInit()
Run("C:\Program Files (x86)\Microsoft Office\Office14\winword.exe")
WinWait("Document1 [Compatibility Mode] - Microsoft Word")
$WordCount = Round ( (TimerDiff($begin)/1000) , 2 )
Run("C:\Program Files (x86)\Microsoft Office\Office14\Powerpnt.exe")
WinWait("Presentation1 [Compatibility Mode} - Microsoft PowerPoint")
$PowerCount = Round ( (TimerDiff($begin)/1000) , 2 )
MsgBox(64,"IS Department Benchmark for Word","Please see the opening time of word." & @CR & $WordCount &"Seconds" & $PowerCount & " seconds")
Link to post
Share on other sites

Not sure if this works more like you wish or not...

Local $begin = TimerInit()
$oWord = ObjCreate("Word.Application")
ProcessWait("winword.exe")
$WordCount = Round ( (TimerDiff($begin)/1000) , 2 )
$oWord.quit

$begin = TimerInit()
$oExcel = ObjCreate("Excel.Application")
ProcessWait("Excel.exe")
$ExcelCount = Round ( (TimerDiff($begin)/1000) , 2 )
$oExcel.quit

$begin = TimerInit()
$oPP = ObjCreate("Powerpoint.Application")
ProcessWait("Powerpnt.exe")
$PPCount = Round ( (TimerDiff($begin)/1000) , 2 )
$oPP.quit

MsgBox(64,"IS Department Benchmarks","Word: " & $WordCount & " seconds" & @CRLF & _
         "Excel: " & $ExcelCount & " seconds" & @CRLF & _
         "Powerpoint: " & $PPCount & " seconds")

Edit: This would only time how long it takes to load and start the program (process), not how long it takes to fully initialize the program, process any parameters, and display a finished window. Maybe there is something in there you'll find inspiring.

Edited by Spiff59
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...