The ProfileScope is used to trace a scope in the Kanzi profiler. More...
Public Member Functions | |
| ProfileScope (String name) | |
| Constructs a ProfileScope object. | |
| void | close () |
| Stops measuring the scope and sends the total time to the profiler. | |
Static Public Member Functions | |
| static void | run (String name, Runnable r) |
| Runs some code within a Profile Scope. | |
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 com.rightware.kanzi.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: @SuppressWarnings("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 | The name of the created profile scope. |