#include "StdAfx.h"
#include "MicroStopwatch.h"


MicroStopwatch::MicroStopwatch(void)
{
	if(!System::Diagnostics::Stopwatch::IsHighResolution)
	{
		throw gcnew System::Exception("High-resolution counter is not available on this system");
	}
	uSecPerTick = (1000 * 1000) / (double)(System::Diagnostics::Stopwatch::Frequency);
}

Int64 MicroStopwatch::ElapsedMicroseconds::get()
{
	return (Int64)(System::Diagnostics::Stopwatch::ElapsedTicks * uSecPerTick);
}
