oren Posted May 26, 2011 Share 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 Link to comment Share on other sites More sharing options...
hannes08 Posted May 26, 2011 Share 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] Link to comment Share on other sites More sharing options...
water Posted May 26, 2011 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 26, 2011 Moderators Share 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 Link to comment Share on other sites More sharing options...
JoHanatCent Posted May 26, 2011 Share 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) Link to comment Share on other sites More sharing options...
UEZ Posted May 26, 2011 Share 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
wakillon Posted May 26, 2011 Share 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.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 26, 2011 Moderators Share 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 Link to comment Share on other sites More sharing options...
wakillon Posted May 26, 2011 Share 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.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
oren Posted May 26, 2011 Author Share Posted May 26, 2011 Thanks.. all Link to comment Share on other sites More sharing options...
MvGulik Posted May 26, 2011 Share 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 ... 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