This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

engine.profiler Functions

Profiler functions allow using counters in your code in the following manner:

Source code (UnigineScript)
begin("my_counter");
// ...code to profile...
end();

Counters can be nested.

void engine.profiler.begin (string name)

Starts a counter with a given name.

Arguments

  • string name - Name of the counter.

void engine.profiler.begin (string name, vec4 color)

Starts a counter with a given name and sets a color for the counter graph.

Arguments

  • string name - Name of the counter.
  • vec4 color - Color of the graph.

float engine.profiler.end ()

Stops the last activated counter and returns its value.

Return value

Value of the counter in milliseconds.

float engine.profiler.getValue (string name)

Returns a value of the specified counter.

Arguments

  • string name - The name of the counter.

Return value

Value of the counter in milliseconds.

int engine.profiler.isEnabled ()

Returns a value indicating if the profiler is enabled.

Return value

1 if the profiler is enabled; otherwise, 0.

void engine.profiler.setValue (string name, string units, variable value, variable max_value = 0, float[] color = 0)

Updates the counter settings.

Arguments

  • string name - Name of the counter.
  • string units - Counter units.
  • variable value - Value of the counter (int or float).
  • variable max_value - Counter maximum value.
  • float[] color - Color of the graph.
Last update: 2017-07-03
Build: ()