kaesereibe Posted July 18, 2014 Posted July 18, 2014 (edited) QueryPerformanceThis example shows just a way to calculate the TimeDiff. Otherwise please use the TimerDiff() function.- MSDN System Information Functions: Kernel32.dll QueryPerformanceCounter- MSDN System Information Functions: Kernel32.dll QueryPerformanceFrequencyFunc QueryPerformance($N = 0) Static $F, $A, $Q, $P, $X Local $R If $N And Not $P Then $F = DllCall("Kernel32.dll", "Int", "QueryPerformanceFrequency", "Int64*", "") $F = $F[1] $P = DllCall("Kernel32.dll", "Int", "QueryPerformanceCounter", "Int64*", "") $P = $P[1] Return $F + $P + ($X = 0) + ($A = 0) EndIf $Q = DllCall("Kernel32.dll", "Int", "QueryPerformanceCounter", "Int64*", "") $A = $A + $Q[1] - $P $P = $Q[1] $X = $X + 1 $R = $A / $X / $F Return ($N And $X = $N) ? BitShift($X = $X - 1, -64) : ($N = 0 And $R) ? ($R + ($A = 0) + ($P = 0) + ($X = 0)) : 1 EndFunc ;==> QueryPerformance() AutoIt v3.3.12.0 Edited July 22, 2014 by kaesereibe BIN 2 DEC | ConvertTemp | DEC 2 BIN | GetWeekday | HEX 2 RGB | INT 2 HEX | QueryPerformance
kaesereibe Posted July 22, 2014 Author Posted July 22, 2014 (edited) Examples:QueryPerformance(1) Sleep(2500) $End = QueryPerformance(0) MsgBox(0, "QueryPerformance()", $End) $i = 0 QueryPerformance(1) While $i <> 10000000 $i += 1 WEnd $End = QueryPerformance(0) MsgBox(0, "QueryPerformance()", $End) Edited July 22, 2014 by kaesereibe BIN 2 DEC | ConvertTemp | DEC 2 BIN | GetWeekday | HEX 2 RGB | INT 2 HEX | QueryPerformance
funkey Posted July 22, 2014 Posted July 22, 2014 This is just the same like this: #include <Timers.au3> Global $Start = _Timer_Init() Sleep(200) ConsoleWrite (_Timer_Diff($Start) & @LF) Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
kaesereibe Posted July 22, 2014 Author Posted July 22, 2014 (edited) Like I said in my top post:"This example shows just a way to calculate the TimeDiff. Otherwise please use the TimerDiff() function."Its the same in short and only 1 functionQueryPerformance(1) startQueryPerformance(0) to get the diff & reset Edited July 22, 2014 by kaesereibe BIN 2 DEC | ConvertTemp | DEC 2 BIN | GetWeekday | HEX 2 RGB | INT 2 HEX | QueryPerformance
careca Posted July 22, 2014 Posted July 22, 2014 (edited) And Global $Start = _Timer_Init() ;to start ConsoleWrite (_Timer_Diff($Start) & @LF) ;to get the diff @kaesereibe that is unnecessarily complicated, all to replace a native function that works. But i do appreciate the effort to come up with something new. Keep it up. Edited July 22, 2014 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
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