Jump to content
robbryjo

Runtime of compiled script as msg box?

Recommended Posts

Hello Community,

i have some script here and want to see the total runtime (or the total runtime - all sleeptimers) as a message box at the end of the script.

Can you please help me?

ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:212]", "test BMS 3.0")
Sleep(100)

ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "B*****")
Sleep(500)
ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "right")
Sleep(100)
ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "{down}")
Sleep(100)
ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "{Enter}")
Sleep(2500)

ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "left")
Sleep(100)
ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "{down}")
Sleep(100)
ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "{down}")
Sleep(1500)

ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "Acer_NB")
Sleep(500)
ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "right")
Sleep(100)
ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "{down}")
Sleep(100)
ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "{Enter}")
Sleep(1500)

ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:165]", "left")
Sleep(100)
ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:156]", "test BMS 3.0")
Sleep(100)
ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:169]", "left")
MsgBox(CAN I PUT IT HERE?)

Edited by robbryjo

Share this post


Link to post
Share on other sites

Global $Runtime = TimerInit() ; This is the first line of your script
;
; YOUR CODE HERE
;
MsgBox(0, "Runtime", TimerDiff($Runtime))

;)


A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) intend to do that to anybody.

Share this post


Link to post
Share on other sites

Global $Runtime = TimerInit() ; This is the first line of your script
;
; YOUR CODE HERE
;
$Runtime / 1000 = $RuntimeInSeconds
MsgBox(0, "Runtime", "Total Runtime: " & $RuntimeInSeconds & " Seconds.")

More friendly version....

Edited by TheDcoder

A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) intend to do that to anybody.

Share this post


Link to post
Share on other sites

ohhh, those interpretations of the OP make much more sense.  Here is my solution to

 

all sleeptimers) as a message box at the end of the script
Global $tooltime

;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:212]", "test BMS 3.0")
_Sleep(100)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "B*****")
_Sleep(500)
;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "right")
_Sleep(100)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "{down}")
_Sleep(100)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:55]", "{Enter}")
_Sleep(2500)
;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "left")
_Sleep(100)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "{down}")
_Sleep(100)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:40]", "{down}")
_Sleep(1500)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "Acer_NB")
_Sleep(500)
;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "right")
_Sleep(100)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "{down}")
_Sleep(100)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW2; INSTANCE:131]", "{Enter}")
_Sleep(1500)
;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:165]", "left")
_Sleep(100)
;~ ControlSend("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:156]", "test BMS 3.0")
_Sleep(100)
;~ ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:169]", "left")

msgbox(0, '' , $tooltime)

Func _Sleep ($time)
    $tooltime += $time
    sleep($time)
EndFunc

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

I Got another Question. When i click this button ..

ControlClick("********** BPoS 2.0 Trainingssystem *********", "", "[CLASS:TWINDOW1; INSTANCE:169]", "left")

--> This is in ADD button

the tool creates a ticket and fills a ticket number in the field (Case ID). this takes about 6 seconds

What i want now is the exact time for ticket creation (about 14 seconds - the runtime till ADD button.)

What have i to fill in ??

The field Name of the Case ID button is

[CLASS:TWINDOW1; INSTANCE:25]

Share this post


Link to post
Share on other sites

Please open a new thread :)


A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) intend to do that to anybody.

Share this post


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

×
×
  • Create New...