Sign in to follow this  
Followers 0
HockeyFan

Script to show elapsed time

4 posts in this topic

:)

Can someone help me with a script that displays elapsed time?? I need this in a tooltip or splashtext showing Hour:Minutes:Seconds. A guess a Tooltip windows would be best becuase when I use sample scripts that use a SpashText box, I get a lot of flickering. This script will run during a long software installation to monitor how long the installation takes. :">

Thanks!! :evil:

Share this post


Link to post
Share on other sites



:)

Can someone help me with a script that displays elapsed time??  I need this in a  tooltip or splashtext showing Hour:Minutes:Seconds.  A guess a Tooltip windows would be best becuase when I use sample scripts that use a SpashText box, I get a lot of flickering.  This script will run during a long software installation to monitor how long the installation takes.  :">

Thanks!! :evil:

<{POST_SNAPBACK}>

when i was first trying to get GUI's, i made a little stopwatch gui... code could probably use some cleaning up, but should suit your purpose...

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("STOPWATCH", 200, 100,-1,-1,-1,$WS_EX_TOPMOST)
$ST = GUICtrlCreateButton("&Start/Stop",-1,50,100,50)
$reset = GUICtrlCreateButton("&RESET",100,50,100,50)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlSetOnEvent($ST,"startstop")
GUICtrlSetOnEvent($reset,"resetit")
$MIN = 00
$SEC = 00
$HR = 00
$lbl = GUICtrlCreateLabel("0" & $HR & ":0" & $MIN & ":0" & $SEC,0,0,200,50,$SS_LEFTNOWORDWRAP)
GUICtrlSetFont($lbl,30)
GUISetState (@SW_SHOW)

$i = 0
While 1
sleep(1000)
if $i = 1 then
if $sec = 59 then
    if $min = 59 then
        $hr = $hr + 1
        $min = 00
        $sec = 00
    else
        $min = $min + 1
        $sec = 00
    endif
else
    $sec = $sec + 1
endif
if $hr < 10 and $min < 10 and $sec < 10 then
GUICtrlSetData($lbl,"0" & $hr & ":0" & $min & ":0" & $sec)
elseif $hr < 10 and $min < 10 then
GUICtrlSetData($lbl,"0" & $hr & ":0" & $min & ":" & $sec)
elseif $hr < 10 then
GUICtrlSetData($lbl,"0" & $hr & ":" & $min & ":" & $sec)
else
GUICtrlSetData($lbl,$hr & ":" & $min & ":" & $sec)
endif
endif
Wend

Func startstop()
if $i = 1 then
$i = 0
else 
$i = 1
endif
EndFunc

Func resetit()
$i = 0
$hr = 00
$min = 00
$sec = 00
GUICtrlSetData($lbl,"0" & $hr & ":0" & $min & ":0" & $sec)
EndFunc


Func CLOSEClicked()
  Exit
EndFunc

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Thanks... :evil:

This is pretty much what I was hopeing for. :)

I've cleaned it up by removing the Start/Stop & Reset buttons and changed it to a Toolwindow...now it serves the function that I needed.

Thanks again!!

Share this post


Link to post
Share on other sites

Thanks... :evil:

This is pretty much what I was hopeing for.  :)

I've cleaned it up by removing the Start/Stop & Reset buttons and changed it to a Toolwindow...now it serves the function that I needed.

Thanks again!!

<{POST_SNAPBACK}>

no prob, glad i could help

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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