cueclub Posted March 31, 2010 Share Posted March 31, 2010 (edited) I'm trying to add the system time to a gui. It would look something like Current Time _______ Time Left _________ <<< this part I'm sure is easy to figure out. I have tried the timenow() and Now() but what I am wanting is for it to update to the sec. Any ideas on where I can find the info? Or can it even be done? Thanks Cue Edited March 31, 2010 by cueclub Link to comment Share on other sites More sharing options...
4Eyes Posted March 31, 2010 Share Posted March 31, 2010 cueclub, Now() gives you a second count. It's not clear what you actually want. AutoIT has a lot of very useful time functions and I've used a lot them. Are you looking for to have the time update every second? If so, can your program sleep for a second? If not, a timer would be the go. Regards, Mike H Link to comment Share on other sites More sharing options...
cueclub Posted March 31, 2010 Author Share Posted March 31, 2010 Well i guess i should have explained it a little better. I want to add a running clock with the current time. not just a time stamp. And then under it I will have a countdown timer. Showing how much time is remaining. I'm wanting to add it to a math test program I am writing for my son. It will give him a set amount of time to finish so many math problems. But I wasn't sure how to go about adding the running clock. Yes i know there is a clock on the computer, but i want his focus to be entirely on 1 area. Thanks Cue Link to comment Share on other sites More sharing options...
KaFu Posted March 31, 2010 Share Posted March 31, 2010 One way... #include <Date.au3> #include <Timers.au3> #include <GuiConstantsEx.au3> $hGUI = GUICreate("Timers", 400, 320) $label_time = GUICtrlCreateLabel(_Now(), 10, 10, 300) GUISetState(@SW_SHOW) $timer_clock = _Timer_SetTimer($hGUI, 1000, "_UpdateClock") ; create timer While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _Timer_KillTimer($hGUI, $timer_clock) Func _UpdateClock($hWnd, $Msg, $iIDTimer, $dwTime) #forceref $hWnd, $Msg, $iIDTimer, $dwTime GUICtrlSetData($label_time, _Now()) EndFunc ;==>_UpdateClock OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
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