If you want to analyze the performance of your logic, you can use the StopwatchLib (which is deployed together with the SharedLibrary Accelerator).

Usage is described here (PFX employees only).