diff options
author | chai <chaifix@163.com> | 2021-11-15 11:54:17 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-15 11:54:17 +0800 |
commit | 30f2f46474bf4eda5f10d4c64a07cde01d469f66 (patch) | |
tree | 6ff2ed3262037b3c9bae2d2b9059a1d65773f31c /Data/DefaultContent/Libraries/middleclass/performance | |
parent | 4c36bed53fe63ae6056730b3ecad2573f03d88f8 (diff) |
*rename DefaultContent -> BuiltIn
Diffstat (limited to 'Data/DefaultContent/Libraries/middleclass/performance')
-rw-r--r-- | Data/DefaultContent/Libraries/middleclass/performance/run.lua | 43 | ||||
-rw-r--r-- | Data/DefaultContent/Libraries/middleclass/performance/time.lua | 13 |
2 files changed, 0 insertions, 56 deletions
diff --git a/Data/DefaultContent/Libraries/middleclass/performance/run.lua b/Data/DefaultContent/Libraries/middleclass/performance/run.lua deleted file mode 100644 index 8d8ba47..0000000 --- a/Data/DefaultContent/Libraries/middleclass/performance/run.lua +++ /dev/null @@ -1,43 +0,0 @@ -local class = require 'middleclass' - -time = require 'performance/time' - -time('class creation', function() - local A = class('A') -end) - -local A = class('A') - -time('instance creation', function() - local a = A:new() -end) - -function A:foo() - return 1 -end - -local a = A:new() - -time('instance method invocation', function() - a:foo() -end) - -local B = class('B', A) - -local b = B:new() - -time('inherited method invocation', function() - b:foo() -end) - -function A.static:bar() - return 2 -end - -time('class method invocation', function() - A:bar() -end) - -time('inherited class method invocation', function() - B:bar() -end) diff --git a/Data/DefaultContent/Libraries/middleclass/performance/time.lua b/Data/DefaultContent/Libraries/middleclass/performance/time.lua deleted file mode 100644 index dd02455..0000000 --- a/Data/DefaultContent/Libraries/middleclass/performance/time.lua +++ /dev/null @@ -1,13 +0,0 @@ -return function(title, f) - - collectgarbage() - - local startTime = os.clock() - - for i=0,10000 do f() end - - local endTime = os.clock() - - print( title, endTime - startTime ) - -end |