//---------------------------------------------------------------------------

#include <fmx.h>
#pragma hdrstop

#include "MainForm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TfmMainForm *fmMainForm;

//extern void whetstones(long xtra, long x100, int calibrate);
//extern void start_time();
//extern double end_time();
extern int whetstone(const int iLoops);

//---------------------------------------------------------------------------
__fastcall TfmMainForm::TfmMainForm(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfmMainForm::btnGoTestClick(TObject *Sender)
{
  lStart = GetTime();
  whetstone(StrToInt(edtLoops->Text));
  lEnd = GetTime();
  ShowRunTime(edtResult, lEnd - lStart);
}

//---------------------------------------------------------------------------

void TfmMainForm::ShowRunTime(TEdit *pEdit, const long lRunTime)
{
  pEdit->Text = FloatToStr(lRunTime / 1000.0) + "¬í";
}

void __fastcall TfmMainForm::FormCreate(TObject *Sender)
{
  if ((int) sizeof(void*) == 4)
	this->Caption = this->Caption  + " 32BIT";
  else
	this->Caption = this->Caption  + " 64BIT";
}
//---------------------------------------------------------------------------

long TfmMainForm::GetTime()
{
	return GetTickCount();
}


