Sign in to follow this  
Followers 0
Raymond Krah

Start / End time

4 posts in this topic

I an searching for a script to see how long a function was active or to see the execution time of that function.

And I have self searched and tried but can't find the right thing:

; Here we make a insert into the ini file so we can read when we started the script
IniWrite(@WorkingDir&"\data\temp\actions.ini","TIME","startTime",_TimeGetStamp())

; Here we are going to look how long the duration was
$startTime = IniRead(@WorkingDir&"\data\temp\actions.ini","TIME","startTime","0")
If($startTime > 0) Then
     $totalTime = Round(_TimeGetStamp()-$startTime)
EndIf       

      ; Display that we are ready and how long it al has taken
      MsgBox(64,"Succes","Alle werkzaamheden zijn gereed en de totale duur was: " & _StringFormatTime('%H, %M, %S', $totalTime))

So in the code above he has to display a time like this: HH/MM/SS like 01:59:25

Can ony one help me whit this problem ? :D

P.S. Sorry for my bad englisch :)

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

This is the one I use when testing my script. I think SlimShady made the UDF, I just modified a little for my own use. This is how I used.

CalcTime('Start')
Your_Function()
CalcTime('Finish', 1)oÝ÷ Ù«­¢+ÙÕ¹
±Q¥µ ÀÌØíÑ¥½¸°ÀÌØí¥5Í ½àôÀ¤(%1½°ÀÌØí
±Q¥µÍѵÁ|ÉlÉt°ÀÌØíMÌ°ÀÌØí5¥¹Ì°ÀÌØí!½ÕÈ(%%ÀÌØíÑ¥½¸ôôÅÕ½ÐíMÑÉÐÅÕ½ÐìQ¡¸($%±½°ÀÌØí
±Q¥µÍѵÁ|ÅlÉt($$ÀÌØí
±Q¥µÍѵÁ|ÅlÁtôQ¥µÉ%¹¥Ð ¤($$ÀÌØí
±Q¥µÍѵÁ|ÅlÅtô}9½Ü ¤(%±Í%ÀÌØíÑ¥½¸ôôÅÕ½Ðí¥¹¥Í ÅÕ½ÐìQ¡¸$$($$ÀÌØí
±Q¥µÍѵÁ|ÉlÁtôI½Õ¹¡%¹Ð¡Q¥µÉ¥ ÀÌØí
±Q¥µÍѵÁ|ÅlÁt¤¤¼ÄÀÀÀ¤($$ÀÌØí
±Q¥µÍѵÁ|ÉlÅtô}9½Ü ¤$$($$ÀÌØí!½ÕÉÌô%¹Ð ÀÌØí
±Q¥µÍѵÁ|ÉlÁt¼ÌØÀÀ¤($$ÀÌØí
±Q¥µÍѵÁ|ÉlÁtô5½ ÀÌØí
±Q¥µÍѵÁ|ÉlÁt°ÌØÀÀ¤($$ÀÌØí5¥¹Ìô%¹Ð ÀÌØí
±Q¥µÍѵÁ|ÉlÁt¼ØÀ¤($$ÀÌØíMÌôI½Õ¹¡5½ ÀÌØí
±Q¥µÍѵÁ|ÉlÁt°ØÀ¤¤$$($($%%ÀÌØí¥5Í   ½àQ¡¸($$%5Í    ½à ØаÅÕ½Ðí
±Q¥µÅÕ½Ðì°ÅÕ½ÐíMÑÉÑÐèÅÕ½ÐìµÀìÀÌØí
±Q¥µÍѵÁ|ÅlÅtµÀì
I1µÀì|($$$$ÅÕ½Ðí¥¹¥Í¡ÐèÅÕ½ÐìµÀìÀÌØí
±Q¥µÍѵÁ|ÉlÅtµÀì
I1µÀì
I1µÀì|($$$$ÅÕ½Ðí±ÁÍèÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀɤèÀɤèÀɤÅÕ½Ðì°ÀÌØí!½ÕÈ°ÀÌØí5¥¹Ì°ÀÌØíM̤¤($%¹%$$($$ÀÌØí
±Q¥µÍѵÁ|ÉlÅtôMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀɤèÀɤèÀɤÅÕ½Ðì°ÀÌØí!½ÕÈ°ÀÌØí5¥¹Ì°ÀÌØíM̤(%¹%(%IÑÕɸ ÀÌØí
±Q¥µÍѵÁ|ÉlÅt¤)¹Õ¹ìôôÐí
±Q¥µ
Edited by Danny35d

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

This is the one I use when testing my script. I think SlimShady made the UDF, I just modified a little for my own use. This is how I used.

CalcTime('Start')
Your_Function()
CalcTime('Finish', 1)oÝ÷ Ù«­¢+ÙÕ¹
±Q¥µ ÀÌØíÑ¥½¸°ÀÌØí¥5Í ½àôÀ¤(%1½°ÀÌØí
±Q¥µÍѵÁ|ÉlÉt°ÀÌØíMÌ°ÀÌØí5¥¹Ì°ÀÌØí!½ÕÈ(%%ÀÌØíÑ¥½¸ôôÅÕ½ÐíMÑÉÐÅÕ½ÐìQ¡¸($%±½°ÀÌØí
±Q¥µÍѵÁ|ÅlÉt($$ÀÌØí
±Q¥µÍѵÁ|ÅlÁtôQ¥µÉ%¹¥Ð ¤($$ÀÌØí
±Q¥µÍѵÁ|ÅlÅtô}9½Ü ¤(%±Í%ÀÌØíÑ¥½¸ôôÅÕ½Ðí¥¹¥Í ÅÕ½ÐìQ¡¸$$($$ÀÌØí
±Q¥µÍѵÁ|ÉlÁtôI½Õ¹¡%¹Ð¡Q¥µÉ¥ ÀÌØí
±Q¥µÍѵÁ|ÅlÁt¤¤¼ÄÀÀÀ¤($$ÀÌØí
±Q¥µÍѵÁ|ÉlÅtô}9½Ü ¤$$($$ÀÌØí!½ÕÉÌô%¹Ð ÀÌØí
±Q¥µÍѵÁ|ÉlÁt¼ÌØÀÀ¤($$ÀÌØí
±Q¥µÍѵÁ|ÉlÁtô5½ ÀÌØí
±Q¥µÍѵÁ|ÉlÁt°ÌØÀÀ¤($$ÀÌØí5¥¹Ìô%¹Ð ÀÌØí
±Q¥µÍѵÁ|ÉlÁt¼ØÀ¤($$ÀÌØíMÌôI½Õ¹¡5½ ÀÌØí
±Q¥µÍѵÁ|ÉlÁt°ØÀ¤¤$$($($%%ÀÌØí¥5Í   ½àQ¡¸($$%5Í    ½à ØаÅÕ½Ðí
±Q¥µÅÕ½Ðì°ÅÕ½ÐíMÑÉÑÐèÅÕ½ÐìµÀìÀÌØí
±Q¥µÍѵÁ|ÅlÅtµÀì
I1µÀì|($$$$ÅÕ½Ðí¥¹¥Í¡ÐèÅÕ½ÐìµÀìÀÌØí
±Q¥µÍѵÁ|ÉlÅtµÀì
I1µÀì
I1µÀì|($$$$ÅÕ½Ðí±ÁÍèÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀɤèÀɤèÀɤÅÕ½Ðì°ÀÌØí!½ÕÈ°ÀÌØí5¥¹Ì°ÀÌØíM̤¤($%¹%$$($$ÀÌØí
±Q¥µÍѵÁ|ÉlÅtôMÑÉ¥¹½ÉµÐ ÅÕ½ÐìÀɤèÀɤèÀɤÅÕ½Ðì°ÀÌØí!½ÕÈ°ÀÌØí5¥¹Ì°ÀÌØíM̤(%¹%(%IÑÕɸ ÀÌØí
±Q¥µÍѵÁ|ÉlÅt¤)¹Õ¹ìôôÐí
±Q¥µ
This works fine in my program and is just what i needed.

Thanks for the fast help. :)

Edited by Raymond Krah

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
Sign in to follow this  
Followers 0