Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Function( Table )
- local Canceled = {}
- return coroutine.wrap(
- function()
- for Key, Value in pairs( Table ) do
- coroutine.yield( false, false, Table, Key, Value )
- if ( type( Value ) == "table" and next( Value ) and not Canceled[Value] ) then
- local _Table = { { Table, Key, Value, pairs( Value ), nil } }
- repeat
- local Maxn = table.maxn( _Table ) local Key, Value = _Table[Maxn][4]( _Table[Maxn][3], _Table[Maxn][5] )
- if ( not Canceled[_Table[Maxn][3]] and not Canceled[_Table[Maxn][1]] and Key and Value ) then
- _Table[Maxn][5] = Key
- coroutine.yield( _Table[Maxn][1], _Table[Maxn][2], _Table[Maxn][3], Key, Value )
- if ( type( Value ) == "table" ) then _Table[Maxn + 1] = { _Table[Maxn][3], Key, Value, pairs( Value ), nil } end
- else
- _Table[Maxn] = nil
- end
- until ( table.getn( _Table ) == 0 )
- end
- end
- end ), function( Table ) local _type = type( Table ) if ( _type == "table" ) then Canceled[Table] = true return true else error( "attempt to cancel (a ".._type.." value) from looping" ) end end
- end
- local Categories = {
- "Lua timing", "Lua memory", "Lib memory", "Packet usage",
- "RPC Packet usage", "Event Packet usage", "Player packet usage", "Sqlite timing",
- "Bandwidth reduction", "Bandwidth usage", "Server info", "Server timing",
- "Function stats", "Debug info", "Debug table", "Help"
- }
- if ( fileExists( "Results.txt" ) ) then fileDelete( "Results.txt" ) end
- local File, Column, Rows = fileCreate( "Results.txt" )
- for Category = 1, 16 do
- Category = Categories[Category]
- fileWrite( File, "\n"..Category..":" )
- Columns, Rows = getPerformanceStats( Category )
- for _, _, _, Key, Value in Function( Columns ) do
- fileWrite( File, "\n\tColumns: \""..tostring( Key ).."\" = \""..tostring( Value ).."\"" )
- end
- for _, _, _, Key, Value in Function( Rows ) do
- fileWrite( File, "\n\tRows: \""..tostring( Key ).."\" = \""..tostring( Value ).."\"" )
- end
- end
- fileClose( File )
- outputChatBox( "Done!" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement