The ProfileScope is used to trace a scope in the Kanzi profiler. More...
Public Member Functions | |
ProfileScope (String name) | |
Constructs a ProfileScope object. More... | |
void | close () |
Stop measuring the scope and send the total time to the profiler. | |
Static Public Member Functions | |
static void | run (String name, Runnable r) |
Run some code within a Profile Scope. More... | |
The ProfileScope is used to trace a scope in the Kanzi profiler.
It is intended to be used with a try-with-resources block, the ProfileScope#run(String, Runnable) method, or manual calling of the ProfileScope#close() method.
By default these traces are disabled. To enable, add either of the following to the application.cfg file. ProfilingCategoryFilter = "*=on" OR ProfilingCategoryFilter = "Interop=on"
To suppress the warning about the scope being an unused variable use: ("try")
ProfileScope | ( | String | name | ) |
Constructs a ProfileScope object.
When it is closed, the time between construction and close is reported to the Kanzi profile subsystem.
name |
|
static |
Run some code within a Profile Scope.
name | The name of the profile scope. |
r | The runnable to run. |