
LuaSandbox::getProfilerFunctionReport 함수는 프로파일러 정보를 반환하는 함수입니다.
이 함수를 호출하기 위해서는 LuaSandbox::getProfiler() 함수를 호출하여 프로파일러 객체를 획득한 후, 이 객체의 getProfilerFunctionReport() 메소드를 호출하면 됩니다.
예를 들어, 다음과 같이 호출할 수 있습니다.
#hostingforum.kr
lua
local profiler = LuaSandbox.getProfiler()
local report = profiler:getProfilerFunctionReport()
이 함수는 Lua 테이블을 반환하며, 이 테이블에는 각 함수의 호출 횟수, 실행 시간, 및 기타 프로파일링 정보가 포함되어 있습니다.
테이블의 구조는 다음과 같습니다.
* 함수 이름 (string)
* 호출 횟수 (number)
* 실행 시간 (number)
* 기타 프로파일링 정보 (table)
예를 들어, 다음과 같이 테이블의 구조를 확인할 수 있습니다.
#hostingforum.kr
lua
local profiler = LuaSandbox.getProfiler()
local report = profiler:getProfilerFunctionReport()
for func, info in pairs(report) do
print(func)
print("호출 횟수:", info.callCount)
print("실행 시간:", info.executionTime)
print("기타 프로파일링 정보:")
for key, value in pairs(info) do
print(key, ":", value)
end
print()
end
이 코드는 프로파일러 정보를 반환하는 테이블을 반복문으로 순회하여 각 함수의 호출 횟수, 실행 시간, 및 기타 프로파일링 정보를 출력합니다.
2025-06-16 11:08