using System; using System.Runtime.InteropServices; using System.Collections; using System.Text; // Filename: Profiler.cs // Author:Sean Kessler namespace IPMonitor { /// Profiler - Profiler utility class public class Profiler { [DllImport("kernel32.dll")] static extern uint GetTickCount(); private uint elapsedTime; private uint totalTime; public Profiler() { totalTime = GetTickCount(); Start(); } public void Reset() { totalTime = GetTickCount(); Start(); } public void Start() { elapsedTime = GetTickCount(); } public uint Split() { return GetTickCount() - elapsedTime; } public uint Stop() { return elapsedTime = GetTickCount() - elapsedTime; } public uint End() { return totalTime = GetTickCount() - totalTime; } } }