jlorenz1 Posted January 23, 2004 Posted January 23, 2004 This script works properply, but displays the time in milliseconds. But I want to display the time in hours:minutes:secondsNo chance with Function MODE. Senseless to reports about all my trials. In a second step I want to multiply the minutes with a value for example "1,2".Is it AutoIT3 without these options or my own incapability ? Thanks from Germany to the rest of the wonderful AutoIT3 worldJohannes $begin = TimerStart()$W_Title = "Timer"while 1 Showstatus("Running for:" & TimerStop($begin)) sleep(1000)wendFunc ShowStatus($msg) if Not WinExists($W_Title,"") then SplashTextOn($W_Title,$msg,300,100,1,1,6,"Arial",8,600) else ControlSetText($W_Title,"","Static1",$msg) EndIfEndFunc Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]
Marc Posted January 23, 2004 Posted January 23, 2004 (edited) About dividing the timecode into h:m:s, how about this? $begin = TimerStart() $W_Title = "Timer" while 1 $dummy = TimerStop($begin)/1000 $dummy2= mod ($dummy, 3600) $hours = ($dummy-$dummy2) / 3600 $dummy = $dummy2 $dummy2= mod ($dummy, 60) $minutes = ($dummy-$dummy2) / 60 $dummy = $dummy2 $seconds= round($dummy) Showstatus("Running for: " & $hours & "hours, " & $minutes & " minutes and " & $seconds & " seconds") sleep(1000) wend Func ShowStatus($msg) if Not WinExists($W_Title,"") then SplashTextOn($W_Title,$msg,300,100,1,1,6,"Arial",8,600) else ControlSetText($W_Title,"","Static1",$msg) EndIf EndFunc Greetings (from Germany, too) Marc Edited January 23, 2004 by Marc Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)
jlorenz1 Posted January 27, 2004 Author Posted January 27, 2004 Hi Marc,thanks for your help Naturally i tried your solution suggestion, but I get following error message:$seconds= round($dummy) -unknown function ROUNDI found no entries about ROUND in help file. In a second trial I commented temporarily all entries about $seconds out and it works properly without seconds.There's only the format of hours and minutes, which are disturbing me. 2 Minutes are showed as 2.000000. I prefers to show as only 2.But this shouldn't diminish my thanks to you. It's only my first impression.Greetings form Griesheim near Darmstadt/GermanyJohannes Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]
Marc Posted January 27, 2004 Posted January 27, 2004 Hi Johannes, the round() function has been introduced in 3.085, do you use an earlier version? My output window looks fine, just says "2 seconds", nothing about "2.000". I suppose after updating your AutoIt to the newest version (3.090), you'll get the same results If not, don't hesitate to say a word... Greetings from Leverkusen, Marc Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)
Administrators Jon Posted January 27, 2004 Administrators Posted January 27, 2004 if it is displaying 2.00000 rather than 2 it is an old version. Upgrade to 3.0.90 Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now