pub struct LuaProfiler;Expand description
An object used to measure script performance.
Since performance is non-deterministic, these objects don’t allow reading the raw time values from Lua. They can be used anywhere a LocalisedString is used, except for LuaGuiElement::add’s LocalisedString arguments, LuaSurface::create_entity’s text argument, and LuaEntity::add_market_item.
Implementations§
Source§impl LuaProfiler
impl LuaProfiler
Sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &str
The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
Sourcepub fn valid(&self) -> bool
pub fn valid(&self) -> bool
Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
Sourcepub fn add(&self, other: LuaProfiler)
pub fn add(&self, other: LuaProfiler)
Add the duration of another timer to this timer. Useful to reduce start/stop overhead when accumulating time onto many timers at once.
If other is running, the time to now will be added.
Trait Implementations§
Source§impl Clone for LuaProfiler
impl Clone for LuaProfiler
Source§fn clone(&self) -> LuaProfiler
fn clone(&self) -> LuaProfiler
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more