I made an universal AutoIT function to calculate the time taken by similar alternative AutoIT commands, in order to compare the different times and chose the fastest or more efficient one:
Do you think that the ProcessSetPriority("AutoIt3.exe", 5) and the $timer_post-$timer_null_command are a good method to obtain more precision?
Note: I then enhanced the script by calculating with a cycle the average time of the last 5 repetitions of the command with a stable (+-15%) time result between the lowest and highest value of the serie (the 5 last values).
[ autoit ]
Func chrono($command) ProcessSetPriority("AutoIt3.exe", 5) ; to set the engine to realtime priority local $timer = TimerInit() ; initialize timer local $timer_null_command = TimerDiff($timer) ; measure the net time without the command (if any) execute($command) ; run the command to be time-measured local $timer_post = TimerDiff($timer) ; stops the chronometer return = return Int($timer_post-$timer_null_command) ; return the net time taken by the command EndFunc
Do you think that the ProcessSetPriority("AutoIt3.exe", 5) and the $timer_post-$timer_null_command are a good method to obtain more precision?
Note: I then enhanced the script by calculating with a cycle the average time of the last 5 repetitions of the command with a stable (+-15%) time result between the lowest and highest value of the serie (the 5 last values).