oren Posted May 26, 2011 Posted May 26, 2011 As the topic say.. Is it possible to know how much time have passed since computer started? , Windows runtime? Thank you
hannes08 Posted May 26, 2011 Posted May 26, 2011 Hello oren, there's awindows tool called systeminfo and I'm sure you can gather this data via WMI. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
water Posted May 26, 2011 Posted May 26, 2011 Here is an example how to do it using WMI. It's written in Visual Basic but this should be easy to convert. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Moderators Melba23 Posted May 26, 2011 Moderators Posted May 26, 2011 oren, This gives the time since boot in ms: $aRet = DllCall("kernel32.dll", "long", "GetTickCount") ConsoleWrite($aRet[0] & @CRLF) M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JoHanatCent Posted May 26, 2011 Posted May 26, 2011 So that should give us this? $aRet = DllCall("kernel32.dll", "long", "GetTickCount") $aRet[0] = $aRet[0]/1000 $days = Int($aRet[0]/(24*60*60)) $remain=Mod($aRet[0],(24*60*60)) $Hours = Int($remain/(60*60)) $remain=Mod($remain,(60*60)) $Mins = Int($remain/60) $Secs=Mod($remain,60) MsgBox(0, '', 'Days = '&$days&@CRLF& _ 'Hours = '&$Hours&@CRLF& _ 'Minutes = '&$Mins&@CRLF& _ 'Seconds = '&$Secs)
UEZ Posted May 26, 2011 Posted May 26, 2011 (edited) Here my version: Br,UEZ Edited May 26, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
wakillon Posted May 26, 2011 Posted May 26, 2011 You can use an AutoIt function too... #include <Date.au3> ConsoleWrite ( "Elapsed Time Since Windows Start in Sec : " & Round ( _Date_Time_GetTickCount ( )/1000 ) & @Crlf ) AutoIt 3.3.18.0 X86 - SciTE 5.5.7 - WIN 11 24H2 X64 - Other Examples Scripts
Moderators Melba23 Posted May 26, 2011 Moderators Posted May 26, 2011 (edited) wakillon, I had a suspicion there was a function available but I could not find it when I looked - the Help file is too big sometimes! M23 Edit: Look familar? Func _Date_Time_GetTickCount() Local $aResult = DllCall("kernel32.dll", "dword", "GetTickCount") If @error Then Return SetError(@error, @extended, 0) Return $aResult[0] EndFunc ;==>_Date_Time_GetTickCount Edited May 26, 2011 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
wakillon Posted May 26, 2011 Posted May 26, 2011 (edited) I was surprised you did not mention this function ! but it's right that there are many date and time functions... Edited May 26, 2011 by wakillon AutoIt 3.3.18.0 X86 - SciTE 5.5.7 - WIN 11 24H2 X64 - Other Examples Scripts
MvGulik Posted May 26, 2011 Posted May 26, 2011 (edited) nevermind. Edited June 28, 2011 by iEvKI3gv9Wrkd41u "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ...
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