#pragma once

#include "MicroStopwatch.h"
#include "PreciseTimerEventArgs.h"

using namespace System;
using namespace System::Timers;
using namespace System::Windows::Forms;

public delegate void PreciseTimerElapsedEventHandler(Object^ sender, PreciseTimerEventArgs^ timerEventArgs); //?? muze byt tu?


ref class PreciseTimer
{
public:
	static event PreciseTimerElapsedEventHandler^ PreciseTimerElapsed;

	Threading::Thread^ _threadTimer;
	Int64 _ignoreEventIfLateBy;
	Int64 _timerIntervalInMicroSec;
	bool _stopTimer;

	PreciseTimer(void);
	PreciseTimer(Int64 IntervalInMicrosec);
	void Start(void);
	void Stop(void);
	//void NotificationTimer(Int64 timerInterval, Int64 ignoreEventIfLateBy, bool stopTimer);
	void NotificationTimer(void);

	property Int64 Interval
	{
		Int64 get();
		void set(Int64 _value);
	}

	property Int64 IgnoreEventIfLateBy
	{
		Int64 get();
		void set(Int64 _value);
	}

	property bool Enabled
	{
		bool get();
		void set(bool _value);
	}
	
	/*ThreadStart ^ThrStart1 = gcnew ThreadStart(this,&Sianaso::Main_form::Sample);
			Thread ^firstThread = gcnew Thread(ThrStart1);
			firstThread->Priority = ThreadPriority::Highest;
			firstThread->Start();*/


};


