Usa las funciones SetTimer y KillTimer (funciones del API)
Seguro que en tu entorno de programación tienes ayuda detallada de estas funciones.
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
int cont = 0;
int idTimer;
VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
{
if (idEvent == idTimer)
++cont;
Form1->Label1->Caption = AnsiString(cont);
return;
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
idTimer = SetTimer(NULL, NULL, 1, (TIMERPROC)TimerProc);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
KillTimer(NULL, idTimer);
}
//---------------------------------------------------------------------------