import{_ as a,a as t,b as r,ag as n}from"./chunks/framework.BcrMLAmg.js";const u=JSON.parse('{"title":"BaseElement","description":"","frontmatter":{},"headers":[],"relativePath":"references/plugins/benchmark.md","filePath":"references/plugins/benchmark.md","lastUpdated":1757840145000}'),o={name:"references/plugins/benchmark.md"};function s(h,e,i,l,d,m){return r(),t("div",null,e[0]||(e[0]=[n('

BaseElement

Functions

MethodReturnsDescription
BaseElement:startProfileBaseElementStarts timing a method call
BaseElement:endProfileBaseElementEnds timing a method call and records statistics
BaseElement:benchmarkBaseElementEnables performance measurement for a method
BaseElement:logBenchmarkBaseElementLogs benchmark statistics for a method
BaseElement:stopBenchmarkBaseElementDisables performance measurement for a method
BaseElement:getBenchmarkStatsstatsRetrieves benchmark statistics for a method

BaseElement:startProfile(methodName)

Starts profiling a method

Parameters

Returns

BaseElement:endProfile(methodName)

Ends profiling a method

Parameters

Returns

BaseElement:benchmark(methodName)

Enables benchmarking for a method

Parameters

Returns

Usage

lua
element:benchmark("render")

BaseElement:logBenchmark(methodName)

Logs benchmark statistics for a method

Parameters

Returns

BaseElement:stopBenchmark(methodName)

Stops benchmarking for a method

Parameters

Returns

BaseElement:getBenchmarkStats(methodName)

Gets benchmark statistics for a method

Parameters

Returns

Container

Extends: VisualElement

Functions

MethodReturnsDescription
Container:benchmarkContainerContainerRecursively enables benchmarking
Container:logContainerBenchmarksContainerRecursively logs benchmark statistics
Container:stopContainerBenchmarkContainerRecursively stops benchmarking

Container:benchmarkContainer(methodName)

Enables benchmarking for a container and all its children

Parameters

Returns

Usage

lua
container:benchmarkContainer("render")

Container:logContainerBenchmarks(methodName)

Logs benchmark statistics for a container and all its children

Parameters

Returns

Container:stopContainerBenchmark(methodName)

Stops benchmarking for a container and all its children

Parameters

Returns

Benchmark

This is the benchmark plugin. It provides performance measurement tools for elements and methods,with support for hierarchical profiling and detailed statistics. The plugin is meant to be used for very big projectswhere performance is critical. It allows you to measure the time taken by specific methods and log the results.

Functions

MethodReturnsDescription
Benchmark.start-Starts timing a custom operation
Benchmark.stop-Stops timing and logs results
Benchmark.getStatsstatsRetrieves benchmark statistics
Benchmark.clear-Removes a benchmark's data
Benchmark.clearAll-Removes all custom benchmark data

Benchmark.start(name, options?)

Starts a custom benchmark

Parameters

Benchmark.stop(name)

Stops a custom benchmark

Parameters

Benchmark.getStats(name)

Gets statistics for a benchmark

Parameters

Returns

Benchmark.clear(name)

Clears a specific benchmark

Parameters

Benchmark.clearAll()

Clears all custom benchmarks

',89)]))}const b=a(o,[["render",s]]);export{u as __pageData,b as default};