help with repeating

 
int live = 22;
if(AccountNumber()== live)

if(AccountProfit()>AccountMargin())

SendMail(" ", " "+AccountProfit());


}



return(0);

i would like that thisi is repeating every 30 minutes


can someone add line code to do this


thanks
 
datetime cnextRun;
if( cnextRun < TimeCurrent() ){
cnextRun = TimeCurrent() + 1800;
SendMail
}
Reason: