Sign in to follow this  
Followers 0
BierBaron

Sleep

4 posts in this topic

hi guys

is started 2 days ago with AutoIt

i wrote a lot of useless scripts and tried some funny things

here my question

can i display the time of "Sleep" in a part of my gui while its counting??

mfg

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Welcome to the forums

Sleep() stops the processing of the script... so

you would need to create a loop to count for you, this could be utilized for your needs

; timer to "thousandths" of a second
; Author - Holger 

While 1
    ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec())
    Sleep(1)
WEnd

Exit

Func _MSec()
    Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
    DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))

    $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8))
    
    $stSystemTime = 0
    
    Return $sMilliSeconds
EndFunc

this and other great additions to your scripts can be found in "Autoit Wrappers" ( in my signature below )

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

wonderfull

great thanks

this is perfect

Share this post


Link to post
Share on other sites

wonderfull

great thanks

this is perfect

Welcome

8)


NEWHeader1.png

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