Results 1 to 6 of 6

Thread: [RESOLVED] Monitor TimeOfDay

  1. #1

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Resolved [RESOLVED] Monitor TimeOfDay

    I'm just looking for some insight or some opinions on the best methods that are out there for monitoring the time of day. I know I could use a timer, but for my particular application I'm working on I'd prefer just to avoid doing so lol. So if there are any other ways of doing so I would greatly appreciate it.

    Keep in mind too this needs to run as silently as possible in the background.. so maybe a thread? I'm new to those as well and am unaware of there performance for long time use and all that other mumbo jumbo.
    Last edited by DavesChillaxin; Oct 20th, 2011 at 11:16 AM.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Monitor TimeOfDay

    hmm.. If you do not wish to use Timer, then you could schedule your application to run at particular time, using Windows scheduler.


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: Monitor TimeOfDay

    Quote Originally Posted by akhileshbc View Post
    hmm.. If you do not wish to use Timer, then you could schedule your application to run at particular time, using Windows scheduler.

    ohh no no no. What I mean is methods of "recreating" what a timer object does, but simply all it will do is monitor the time of day in the background triggering notifications as necessary. IE a scheduler program, which will in turn notify the user of any appointments as they occur.. I'm just interested to see what other alternatives there are out there and available.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Monitor TimeOfDay

    There are no alternatives. You have to use a Timer. You can either make a Timer Tick once at the exact time you want something to happen or you can make a Timer Tick repeatedly and, each time, check whether it is time to perform your action.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: Monitor TimeOfDay

    Okay, okay.. I guess I'll stick with a timer. But how would I go about calculating the offset from the actual time to the time the timer started at?

    For example if I start the timer at 10:46am, then the next tick wont occur till 11:01am which if so will always yield no results seeing that all my appointments are scheduled by a 15 minute interval.. I'm just left wondering how I would go about accurately syncing my timer up with the actual time so that it always ticks with the time at 15 minute intervals. If off by even milliseconds would eventually, but surely throw off my timer.
    Last edited by DavesChillaxin; Oct 20th, 2011 at 09:42 PM. Reason: spelling
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Monitor TimeOfDay

    The Interval of a Timer is measured in milliseconds. You can make it as accurate as you want. If it's 7 1/2 minutes until the appointed time when you Start the Timer then you set the Interval accordingly, i.e. 450000. If you need to adjust the Interval once the Timer Ticks for the first time then do so.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width