Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Method executing at specific (clock) time

Method executing at specific (clock) time

Scheduled Pinned Locked Moved C#
helptutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    javamdk
    wrote on last edited by
    #1

    :confused:I need some help... I have a method that I want to execute at a specific time. For example, every 3PM it will execute this method. Any suggestions or help on this. I don't think it would be that difficult... I was thinking I could just capture the system time, on form load. Then while (system time == 3PM) execute method. Not sure if that would work Let me know asap! Thanks guys

    F 1 Reply Last reply
    0
    • J javamdk

      :confused:I need some help... I have a method that I want to execute at a specific time. For example, every 3PM it will execute this method. Any suggestions or help on this. I don't think it would be that difficult... I was thinking I could just capture the system time, on form load. Then while (system time == 3PM) execute method. Not sure if that would work Let me know asap! Thanks guys

      F Offline
      F Offline
      fang_eric
      wrote on last edited by
      #2

      i think that use the Timer will match your needs.

      J 1 Reply Last reply
      0
      • F fang_eric

        i think that use the Timer will match your needs.

        J Offline
        J Offline
        javamdk
        wrote on last edited by
        #3

        yeah - i'm kind of figuring out how that works. I created an action for the timer tick below: private void tmrClock_Tick(object sender, EventArgs e) { if( sender == tmrClock ) { //perform method ? Invalidate(); } On Form load, I have the timer interval set to a few thousand milliseconds. Then I start the timer. This is all I have so far. I'm guessing my method goes in the tmrClock_Tick? Is that right?

        C 1 Reply Last reply
        0
        • J javamdk

          yeah - i'm kind of figuring out how that works. I created an action for the timer tick below: private void tmrClock_Tick(object sender, EventArgs e) { if( sender == tmrClock ) { //perform method ? Invalidate(); } On Form load, I have the timer interval set to a few thousand milliseconds. Then I start the timer. This is all I have so far. I'm guessing my method goes in the tmrClock_Tick? Is that right?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          javamdk wrote:

          I'm guessing my method goes in the tmrClock_Tick?

          Correct. This method is called when the timer fires.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups