Advertisement
Guest User

Untitled

a guest
Dec 28th, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.06 KB | None | 0 0
  1. #include "AutoItObject.au3"
  2. #include "..\AutoItObject-Internal-3.0.0\AutoItObject_Internal.au3"
  3.  
  4.  
  5. ; Variable
  6. $var = 'Variable'
  7. ; cycle 10k
  8. $h_main_loop_timer = TimerInit()
  9. For $i = 1 To 10000
  10.     $temp = $var
  11. Next
  12. _console_time($var &Chr(9)&Chr(9)&Chr(9)& ' cycle 10k' &Chr(9), $h_main_loop_timer)
  13. ; one
  14. $h_main_loop_timer = TimerInit()
  15. _console_time($var &Chr(9)&Chr(9)&Chr(9)& ' one' &Chr(9)&Chr(9), $h_main_loop_timer)
  16.  
  17.  
  18.  
  19.  
  20. ; AutoItObject UDF 1st
  21. _AutoItObject_Startup()
  22. Global $FirstObj = FirstObj()
  23. Func FirstObj()
  24.     Local $this = _AutoItObject_Class()
  25.     $this.AddProperty('var')
  26.     Return $this.Object
  27. EndFunc
  28. $FirstObj.var = 'AutoItObject UDF FirstObj'
  29. ; cycle 10k
  30. $h_main_loop_timer = TimerInit()
  31. For $i = 1 To 10000
  32.     $temp = $FirstObj.var
  33. Next
  34. _console_time($FirstObj.var &Chr(9)& ' cycle 10k' &Chr(9), $h_main_loop_timer)
  35. ; one
  36. $h_main_loop_timer = TimerInit()
  37. _console_time($FirstObj.var &Chr(9)& ' one' &Chr(9)&Chr(9), $h_main_loop_timer)
  38.  
  39.  
  40.  
  41.  
  42. ; AutoItObject UDF 2nd
  43. Global $SecondObj = _AutoItObject_Create()
  44. _AutoItObject_AddProperty($SecondObj, 'var')
  45. $SecondObj.var = 'AutoItObject UDF SecondObj'
  46. ; cycle 10k
  47. $h_main_loop_timer = TimerInit()
  48. For $i = 1 To 10000
  49.     $temp = $SecondObj.var
  50. Next
  51. _console_time($SecondObj.var &Chr(9)& ' cycle 10k' &Chr(9), $h_main_loop_timer)
  52. ; one
  53. $h_main_loop_timer = TimerInit()
  54. _console_time($SecondObj.var &Chr(9)& ' one' &Chr(9)&Chr(9), $h_main_loop_timer)
  55.  
  56.  
  57.  
  58.  
  59. ; AutoItObject Internal
  60. $oIDispatch = IDispatch()
  61. $oIDispatch.var = 'AutoItObject Internal'
  62. ; cycle 10k
  63. $h_main_loop_timer = TimerInit()
  64. For $i = 1 To 10000
  65.     $temp = $oIDispatch.var
  66. Next
  67. _console_time($oIDispatch.var &Chr(9)&Chr(9)& ' cycle 10k' &Chr(9), $h_main_loop_timer)
  68. ; one
  69. $h_main_loop_timer = TimerInit()
  70. _console_time($oIDispatch.var &Chr(9)&Chr(9)& ' one' &Chr(9)&Chr(9), $h_main_loop_timer)
  71.  
  72.  
  73.  
  74.  
  75. Func _console_time($func, $h_timer)
  76.     _console_log($func&' => '&Round(TimerDiff($h_timer), 3)&' ms', '_console_time')
  77. EndFunc
  78. Func _console_log($text, $func)
  79.     ConsoleWrite($text&Chr(9)&' || '&$func&@CRLF)
  80. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement