在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
local test = {} for i = 10, 10000 do test[ i ] = {} end local t1 = os.clock( ) for i = 1, 100000 do test[ 1000 ].mValue = 100 end local t2 = os.clock( ) - t1 Misc.Trace( "cost - " .. t2 ) t1 = os.clock( ) local d = test[ 1000 ] for i = 1, 100000 do d.mValue = 100 end t2 = os.clock( ) - t1 Misc.Trace( "cost - " .. t2 ) 这两个效率有很大差别 |
请发表评论