Automatically Fire the Event Export to Excel

Hi,
This is the Simple Code.In this Code I make an infinity loop and match the future time to system time. if condition is true then loop is break.
  1. while (true)   
  2. {  
  3.     try   
  4.     {  
  5.         long ScheduleDateTime = ConvertToUnixEpoch(Convert.ToDateTime(txtSchedule.Text));  
  6.         long datetimesystem = ConvertToUnixEpoch(DateTime.Now);  
  7.         if (datetimesystem == ScheduleDateTime)   
  8.         {  
  9.             SearchBounceBackHistory();  
  10.             ExportExcel(txtExportFileName.Text);  
  11.             break;  
  12.         }  
  13.     } catch (Exception ex)   
  14.     {  
  15.         SearchBounceBackHistory();  
  16.         ExportExcel(txtExportFileName.Text);  
  17.     }  
  18. }