title: Threading.Timer application is consuming more than 50% of CPU, why?
body: <p>I have written below console application in VB.net. </p>
  
  <p>My intention is to write an application that triggers every one minute and perform some task. But</p>
  
  <p>when I run this application it is consuming 50% of CPU. </p>
  
  <p>How can I make it to consume less CPU? </p>
  
  <p>Am I calling the timer in the right place (In the main method)? </p>
  
  <p>Later I would like to make a windows service with this same task and install on the server. </p>
  
  <p>How can I make the application consume less CPU? </p>
  
  <pre><code>Module Module1
  
      Dim inputPath As String = "C:\Input"
      Dim outputPath As String = "C:\Output"
      Dim folder As Directory
  
      Sub Main()
          Dim tmr As Timer = New Timer(New TimerCallback(AddressOf Upload), Nothing, 1000, 60000)
          While Not tmr Is Nothing
          End While
  
      End Sub
  
      Public Sub Upload(ByVal o As Object)
          Dim sr As StreamReader
          Dim conStr1 As String = "Data Source=TNS Name;User ID=xx; Password=xx;"
          'Look up for pending requests in RQST_TBL
          Dim cnn1 As New OracleConnection(conStr1)
          Dim datReader As OracleDataReader
          Dim cmd1 As New OracleCommand
          cnn1.Open()
          .....
          .....
      End Sub
  
  End Module
  </code></pre>
  
  <p>Thank you..</p>