Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "AutoItObject.au3"
- #include "..\AutoItObject-Internal-3.0.0\AutoItObject_Internal.au3"
- ; Variable
- $var = 'Variable'
- ; cycle 10k
- $h_main_loop_timer = TimerInit()
- For $i = 1 To 10000
- $temp = $var
- Next
- _console_time($var &Chr(9)&Chr(9)&Chr(9)& ' cycle 10k' &Chr(9), $h_main_loop_timer)
- ; one
- $h_main_loop_timer = TimerInit()
- _console_time($var &Chr(9)&Chr(9)&Chr(9)& ' one' &Chr(9)&Chr(9), $h_main_loop_timer)
- ; AutoItObject UDF 1st
- _AutoItObject_Startup()
- Global $FirstObj = FirstObj()
- Func FirstObj()
- Local $this = _AutoItObject_Class()
- $this.AddProperty('var')
- Return $this.Object
- EndFunc
- $FirstObj.var = 'AutoItObject UDF FirstObj'
- ; cycle 10k
- $h_main_loop_timer = TimerInit()
- For $i = 1 To 10000
- $temp = $FirstObj.var
- Next
- _console_time($FirstObj.var &Chr(9)& ' cycle 10k' &Chr(9), $h_main_loop_timer)
- ; one
- $h_main_loop_timer = TimerInit()
- _console_time($FirstObj.var &Chr(9)& ' one' &Chr(9)&Chr(9), $h_main_loop_timer)
- ; AutoItObject UDF 2nd
- Global $SecondObj = _AutoItObject_Create()
- _AutoItObject_AddProperty($SecondObj, 'var')
- $SecondObj.var = 'AutoItObject UDF SecondObj'
- ; cycle 10k
- $h_main_loop_timer = TimerInit()
- For $i = 1 To 10000
- $temp = $SecondObj.var
- Next
- _console_time($SecondObj.var &Chr(9)& ' cycle 10k' &Chr(9), $h_main_loop_timer)
- ; one
- $h_main_loop_timer = TimerInit()
- _console_time($SecondObj.var &Chr(9)& ' one' &Chr(9)&Chr(9), $h_main_loop_timer)
- ; AutoItObject Internal
- $oIDispatch = IDispatch()
- $oIDispatch.var = 'AutoItObject Internal'
- ; cycle 10k
- $h_main_loop_timer = TimerInit()
- For $i = 1 To 10000
- $temp = $oIDispatch.var
- Next
- _console_time($oIDispatch.var &Chr(9)&Chr(9)& ' cycle 10k' &Chr(9), $h_main_loop_timer)
- ; one
- $h_main_loop_timer = TimerInit()
- _console_time($oIDispatch.var &Chr(9)&Chr(9)& ' one' &Chr(9)&Chr(9), $h_main_loop_timer)
- Func _console_time($func, $h_timer)
- _console_log($func&' => '&Round(TimerDiff($h_timer), 3)&' ms', '_console_time')
- EndFunc
- Func _console_log($text, $func)
- ConsoleWrite($text&Chr(9)&' || '&$func&@CRLF)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement