using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Windows.Forms; namespace FastReport.Utils { /// /// The profiler. /// public static class Profiler { private static long FMemory; private static int FTickCount; /// /// Starts the profiler. /// public static void Start() { FMemory = Process.GetCurrentProcess().PrivateMemorySize64; FTickCount = Environment.TickCount; } /// /// Finishes the profiler and displays results. /// public static void Stop() { MessageBox.Show(((Process.GetCurrentProcess().PrivateMemorySize64 - FMemory) / 1024).ToString() + " Kb" + '\r' + (Environment.TickCount - FTickCount).ToString() + " ms"); } } }