using System;
using System.Runtime.InteropServices;
using System.Collections;
using System.Text;

// Filename: Profiler.cs
// Author:Sean Kessler

namespace MarketData.Utils
{
  /// <summary>Profiler - Profiler utility class</summary>
  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 Stop()
    {
      return elapsedTime = GetTickCount() - elapsedTime;
    }
    public uint End()
    {
      return totalTime = GetTickCount() - totalTime;
    }
    public uint Split()
    {
      return GetTickCount() - elapsedTime;
    }
  }
}

