NoHAX Posted April 1, 2011 Posted April 1, 2011 I need to reset timer value, eg. timer = _TimerInit() If _Timer_Diff($timer) Then ; Set $timer value to 0 EndIf I tried sth with KillTimer but it wont work
hench Posted April 1, 2011 Posted April 1, 2011 re-init the timer with the same first line but within the if-then statement timer = _TimerInit() If _Timer_Diff($timer) Then ; Set $timer value to 0 timer = _TimerInit() EndIf there are inbuilt functions TimerInit / TimerDiff in AutoIt, you might want to use them instead of an extra include. g'day! hench
kaotkbliss Posted April 2, 2011 Posted April 2, 2011 $timer = TimerInit() If TimerDiff($timer) > 3000 Then $timer = TimerInit() EndIf 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
JustSomeone Posted February 10, 2014 Posted February 10, 2014 ~Sorry for the necro but this sems quite what i need and its like 3rd result on search page ~ Due recent hard-drive fault i lost a log-rotation program and i need to rewrite it now. I remember, when using timers within a program , and if that program is running more than 24h, the timers begin to be innacurate. I cannot remember wich one was , the built-in timer or the included one, so can someone tell me does _TimerInit (i am zeroing the timer from within an If-else statement) affect the accuracy of the timer, or i need to completly kill it and init it again ? i am also not sure does this problem exist, it was long ago since i noticed this, and never actually used timers after that, so my opinion is to ask the geeks The timer difference occur when the computer is under very heavy load (and the one i use is ), and after 24th hour timers begin to be very inaccurate (+- 30 secs and more) code represent few keys being pressed every 30 min (exactly 30 min) i believe there is no need of source here.
Moderators Melba23 Posted February 10, 2014 Moderators Posted February 10, 2014 JustSomeone,As far as I know both native and UDF timers just look at the difference in CPU "ticks" since they were initiated and are not really designed for delays of the size you are using. I would strongly suggest creating your own function using _DateDiff & _NowCalc - then your timings are based on the accuracy of the PC clock, and mine certainly does not vary by 30 secs a day. 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
FireFox Posted February 10, 2014 Posted February 10, 2014 You can also use epoch functions (based on date functions), you can find some on the forum. In my opinion it's more efficient for algorithmic calculation Br, FireFox.
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