timer

How do I get the Exception that happens in Timer Elapsed event?

I'm working with Windows Forms application and hava a manager class that uses System.Timers.Timer to periodly check data from database. How do I get the Exception that occurs in timer Elapsed eventhandler delivered into main application? If I'm using the code below, the exception get's "swallowed", and main application never gets it (e...

Why doesn't TTimer work correctly?

Hello all, As you can tell, I am having a little trouble with the TTimer VCL component within my application developed using Delphi 2010. Whenever I call: Self.Timer1.Enabled := False; Self.Timer1.Enabled := True; The timer component does seem to indeed halt, but, it never starts up again. Like, it never calls the OnTimer event. I ...

Can I have a timer running during iOS 4.0+ multi-tasking?

So I have just managed to build a timer on my iOS app I'm working on, and it works great! Except for the fact that the whole point of the timer is to be able to multi-task with it. Meaning, I want to be able to be in my app, set a timer, hit go, have it start ticking down to 0, and allow users to switch over to another app, and do that ...

C# execute action after X seconds

I want to develop a windows console application which executes an action periodically after a given time. I've read somewhere that a timer class is only available for windows forms applications, so what is the best way to accomplish what I want? ...

What periodic timer objects are available in the Windows API?

In researching options for getting better than the 15 ms resolution provided by .NET timer objects (see http://stackoverflow.com/questions/3744032/why-are-net-timers-limited-to-15-ms-resolution), I am looking at the different timer objects that Windows provides. I have identified the following: Old style Windows timer Multimedia timer...

Updating UI with Runnable & postDelayed not working with timer app

I have looked at every discussion and thread I can find on getting this to work but it is not. I have a simple timer that updates a text view (mTimeTextField in the example below). The mUpdateTimeTask run method is being executed correctly (every second) but the UI/text field is not being updated. I have code based on the info found her...

Stop the timer / Automated flow when user clicks on any digit.

I have a slider that rotates between different divs nicely with the following code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; <script type="text/JavaScript"> $(document).ready(function (){ function showSlide(integer) { $('#myslide .cover').css({l...

Android: How to start an activity at a specified time?

I'm making an alarm clock of sorts, and I was wondering what the best way to start an activity at a certain time would be. Would it be using the broadcast service or... ...

Stop Timer in Closures Using F#

I want to ask a simple question how to stop this timer. Somebody's code is like this : let mutable timer = new DispatcherTimer() timer.Interval - new TimeSpan(0,0,0,0,100) timer.Start() and I want to add a function that cause the timer to stop whenever I click button So I put a code like this (I don't really have a clue) ...

jQuery how to make event occur every x seconds?

Hey. I have a code like: $("#clickMe").click( function(){ if (i == 1) { i = i+1 $("#div p").css("left", "-" + width * i + "px"); } }); As you can see -margin changes when somebody clicks a button. What if I want it to happen j...

My KeyEvents don't get registered while the Timer is firing events. How to fix this?

Hi everyone, java noob here. In my Application class, I have a JPanel with focusable set to true and a KeyListener class added to it. I also have a Timer registered with a TimerListener class set up in the Application's main function. The KeyEvents work, but once I press the JButton to call timer.start(), KeyEvents stop firing and only t...

how to use ajax timer in jquery?

dear all.. i'm new to ajax timer, since someone tell me to use it for make my page can auto refresh. can you tell how to use it for my jquery page? ...

How to remove items from list x seconds after adding them

Hi. I need to remove items from list few seconds after i added them. I have now an ObservableCollection to which I add some messages. I need them to be deleted let's say 5 seconds after they were added. I tried to create a function responsible for adding the items and setting a timer: public void AddInfoItem(string info) { ...

can't we use 2 timer events in a single application.....

Hi Can we use 2 timer events in a single application. I'm trying to use 2 timer events in a single application but the 2nd timer event is not working.... any one have an idea??? how to use 2 timer events in a single application.... Thanks in advance.... ...

Periodicall popup form

Hello. I should implement periodically popup form at other form. This popup form isn't common design, so I couldn't use standard messages. I need implement smoothly showing\hiding of this popup form. Now I use timers for hide\show this form, but have strange problems. If I run only Show\Hide popup form process all is OK, but when I try ...

What is the preferred method to manage a timed event with a Web application?

I'm designing an ASP.NET 4.0 Web application where administrators may create an auction with an expiration. The expiration time would be stored in a database. How can I ensure that the auction ends at the predetermined time, considering the fact that an application instance may not be running when it is time? The application will be host...

How to run java function for only 30 minutes

I need to create a java function that will only run for 30 minutes, and at the end of the 30 minutes it executes something. But it should also be able to self terminate before the given time if the right conditions are met. I don't want the function to be sleeping as it should be collecting data, so no sleeping threads. Thanks ...

If the autoreset is set to false, will my timer be disposed automaticaly ?

I launch a timer only one time in my application : CustomTimer timer = new CustomTimer(mod); timer.Interval = interval.TotalMilliseconds; timer.AutoReset = false; timer.Start(); So the AutoReset is set to false. At the end of the timer, will the dispose method be called automatically ? ...

What's the most accurate way of measuring elapsed time in a modern PC?

I know I can use IRQ0, which is the system timer, but this is based on a 14.31818MHz clock, right? Is there anything offering greater precision? Thanks. Edit: Does anyone know what the Windows function QueryPerformanceCounter uses? ...

VB.NET Using a custom timer in a lambda expression in its own "New" statement - is it okay?

This works, and I can't imagine how it might cause problems, but visual studio gives me an warning and that makes me sad. I'm just wondering if doing something like this might ever cause problems: I have a custom timer that acts like a Wait for some number of milliseconds and then execute a function. It looks like this: Public Class ...