infinitr Posted June 9, 2010 Share Posted June 9, 2010 Hello,I am having problems with accurate timings. I ultimately want to record the amount of time it takes for a window to appear following the entry of some data in another field (or another window closing). I have started with the sample script and am experiencing unexpected results.for $i = 1 to 10 $begin = TimerInit() sleep(3000) $dif = TimerDiff($begin) MsgBox(0,"Time Difference",$dif) nextResults displayed in the MsgBox are:1550.7851035.3641025.4492285.864917.707849.383996.1701129.5231377.241924.231Can someone explain please? I was expecting these results to hover around 3000. Thank you. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 9, 2010 Moderators Share Posted June 9, 2010 infinitr,Welcome to the Autoit forum. I have just run your code and got these results, which are exactly as I (and you) expected:3001.18206364217 3008.06890261192 3006.11146109352 3004.11427988753 3007.11766439589 3002.66660986243 3003.56134648398 3001.1143874431 3003.1131749985 3003.11080039502Is there anything unusual about your system? Have you made any "unauthorised" adjustments to the CPU, for example? 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...
infinitr Posted June 9, 2010 Author Share Posted June 9, 2010 Thank you. :)Been around before but it's been awhile and I guess I lost my login. No I have not (hacked at the computer), but it has been running continuously for while. Let me try the old reboot and see what happens, being that from what I understand, the TimerInit(timestamp) is related to how long the system has been running. However, even if it works it would still wouldn't make a while lot of sense to me and would make me question reliability. >>>>CTRL,ALT,DELETE Link to comment Share on other sites More sharing options...
infinitr Posted June 9, 2010 Author Share Posted June 9, 2010 Reboot, Shutdown, same problem. Any other ideas? Thanks. Link to comment Share on other sites More sharing options...
MvGulik Posted June 9, 2010 Share Posted June 9, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "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...
jchd Posted June 9, 2010 Share Posted June 9, 2010 Tell us which type of machine you're running that on: old laptop, recent 4-cores desktop, 4x 12-core server ... Which system are you running? Can you also try compiling that into .exe and set compatibility = W98. What do you get then? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
jaberwacky Posted June 9, 2010 Share Posted June 9, 2010 Does this fix the problem? Global $begin, $dif $begin = TimerInit() For $i = 1 To 10 Sleep(3000) $dif = TimerDiff($begin) ConsoleWrite("Time Difference " & $dif & @CRLF) Next Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
infinitr Posted June 10, 2010 Author Share Posted June 10, 2010 (edited) Intel Core 2 Quad 2.66Ghz, Windows XP Pro sp3 The results of the script posted above are: Time Difference 1376.37494755679 Time Difference 4161.99367222803 Time Difference 5596.52254043203 Time Difference 6603.26348222946 Time Difference 7675.32921406606 Time Difference 8515.08013924707 Time Difference 9502.69111059315 Time Difference 10404.5421162247 Time Difference 11406.1631987729 Time Difference 12394.4574431771 I still have to look into the other suggestions and report back....thank you. Edited June 10, 2010 by infinitr Link to comment Share on other sites More sharing options...
infinitr Posted June 10, 2010 Author Share Posted June 10, 2010 ...and set compatibility = W98. What do you get then?Tried searching, how do I set this? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 10, 2010 Moderators Share Posted June 10, 2010 infinitr,If you have Vista or Win7, right click on the .exe file and look under the "Compatability" tab on the properties box. You should see a "Compatability Mode" checkbox and combo - just check and select "Win98".Your exe then runs as if under that OS - although I have no idea why jchd wants you to do so. 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...
jchd Posted June 10, 2010 Share Posted June 10, 2010 W98 compatibility works the same for XP. Digging around I read that this solves the issue for "some" chipsets/machines/drivers/OSses/WTF. Since it's easy to try and no risk, why not give that a chance? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) 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