20,741
edits
| Line 296: | Line 296: | ||
=== Tracking update frequency per Canvas/Element === | === Tracking update frequency per Canvas/Element === | ||
This is intended to help people better understand how frequently a Canvas is being updated, which happens automatically once a property in the sub-tree is modified (usually involving timers and listeners): | This is intended to help people better understand how frequently a Canvas is being updated, which happens automatically once a property in the sub-tree is modified (usually involving timers and listeners): | ||
<syntaxhighlight lang="diff"> | |||
</syntaxhighlight> | |||
=== Tracking update/rendering duration per Canvas/Element === | |||
This is a fairly useful thing to do, while also being pretty easy - all that is needed are two SimGear classes: | |||
* PropertyObject<> | |||
* SGTimeStamp | |||
These two can be used to time the duration of each method invocation and automatically write it to the property tree. Which in turn can then be viewed/processed by the property browser and/or Nasal respectively to identify comparatively expensive canvas elements/groups. | |||
<syntaxhighlight lang="diff"> | <syntaxhighlight lang="diff"> | ||