timer

Changing the interval of SetInterval while it's running

I have written a javascript function that uses setInterval to manipulate a string every tenth of a second for a certain number of iterations. function timer() { var section = document.getElementById('txt').value; var len = section.length; var rands = new Array(); for (i=0; i<len; i++) { rands.push(Math.floor(Mat...

The Window Sitter project -- something better than a timer?

For my window sitter project (remember that one question about colorkeying?) I'm currently using a Timer to update the character's position, like I did with the original VB6 version. There are, however, a few problems with this approach: If you switch windows or move the foreground window fast enough, the character lags unless you set t...

ASP.Net + SQL Server Design/Implementation Suggestions

Hello all, I'm constructing a prototype site for my company, which has several thousand employees and I'm running into a wall regarding the implementation of a specific requirement. To simplify it down with an example, lets say each user has a bank account with interest. Every 5 minutes or so (can vary) the interest pays out. When the...

Timing? - cocoa

Hi guys, How would I be able to use timers? For example I want to show a certain text for 10 seconds and then I want to show a different text for the rest of the duration. Thanks, Kevin ...

SharePoint: Timerjobs Lock Type

Hi I am trying to create a timer job in WSS 3.0. My timer job would create the object of SPsite then SPWeb and then SPDocumentLibrary (or possibly picture library)using their GUIDs stored in any xml or database.After that it would take the back up of documents in the document library in some third party application and then delete thos...

iPhone Add a timer at Navigation Bar

HI , i have made simple application with 5 view controllers with some functionality .. what i want to do now is add a time at the main screen . and it should b running till i quit from application .. i will move to other view controllers also but that timer would b running .. how i will have this functionality ?? ...

Stopwatch not incrementing

I don't understand why this code fails to measure when 4 hours has elapsed. if (guildVaultRunStarter.IsRunning) { if (guildVaultRunTimer.ElapsedMilliseconds > 4 * 60 * 60 * 1000) // 4 hours { guildVaultRunStarter.Reset(); log("Its been over 4 hours - empty bags."); return true;...

Waiting for a Timer to finish in Java

I'm using java.util.Timer to schedule a periodic task. At one point, I'd like to shut it down, and wait for it to finish. Timer.cancel() will prevent any future tasks from running. How do I make sure any tasks are not running at the moment (or wait for them if they are?) I can introduce external synchronization mechanisms, but I don't ...

flot graph on a timer

I want my flot graph to update it's data on set intervals. I have been unable to find any built in functionality that does this so I intend to do something along the lines of redrawing the graph each time an interval expires. The data parameter being passed to flot is the only value that will change. The data variable is populated using ...

.NET, event every minute (on the minute). Is a timer the best option?

I want to do stuff every minute on the minute (by the clock) in a windows forms app using c#. I'm just wondering whats the best way to go about it ? I could use a timer and set its interval to 60000, but to get it to run on the minute, I would have to enable it on the minute precisely, not really viable. I could use a timer and set its...

any better timer in asp.net ?

I used System.Timers.timer in global.as in asp.net to set a timer for scheduling execute a function let' say transferMoney(). But it seems that this timer might stop after several hours unexpected. And this cause that all the actions are pending. I want to know whether there are any better methods to set up a timer in asp.net, MVC 1....

JBoss 4 Timer Service - Will an new Timeout (ejbtimeout) will be invoked if the last one did not returned yet?

Hi, I am using JBoss Timer service. I annotated a method with @Timeout. If the time has come and the ejbTimeout method invoked but not completed before the next interval comes will another ejbTimeout method will be invoked? Thanks, Rod ...

NSThread, NSTimer and AutoreleasePools in an iPhone SDK application

Hello every one, I want to create an appilication in iPhone in which I want to use NSThread. I have created one thread using [NSThread detachNewThreadSelector:@selector(doThread:) toTarget:self withObject:nil]; I want that my one thread will handle all the touches and other user interaction and the second thre...

Boost Threads and Timers, C++

I have this code for a custom class 'sau_timer': sau_timer::sau_timer(int secs, timerparam f, vector<string> params) : strnd(io), t(io, boost::posix_time::seconds(secs)) { assert(secs > 0); this->f = f; this->params = params; t.async_wait(strnd.wrap(boost::bind(&sau_timer::exec, this, _1))); boost::thread thrd(b...

How to create a Java timer that repeats at different times

I have some stock market data. I want to simulate the stock market by having prices sent at intervals that can be determined from the times at which trades occur. What would the best way be to do this. So far I have a class with static variables and methods in which I am storing the hour, min, millseconds for the last trade time. I th...

My Timer event crashes because the events are called on a different thread.

I get the error "Cross-thread operation not valid: Control 'label1' accessed from a thread other than the thread it was created on." when I run this code: using System; using System.ComponentModel; using System.Data; using System.Text; using System.Windows.Forms; using System.Timers; namespace WindowsFormsApplication1 { public part...

Timers in .net - which to use when?

There are three Timer classes in .net (Timers.Timer, Threading.Timer and Windows.Forms.Timer). Which should be used when? and What are performance implication of using them? ...

Hi all,How to use TIMERS in vc++? I want to run different functions or code after a definite time interval(say 10 ms) without using Sleep().Please help

Hi all i want to execute code similar to a Interrupt service routine after a timer expires(say print hello after every 10ms) and this is a supplementary activity so it has to be using a timer .So how do i implement timers in vc++ ...

Javascript: How to measure the milliseconds between mousedown and mouseup?

Looks like you can't call setInterval() from the onMouseDown event handler. I tried, didn't work. By John Resig's explanation, this makes sense: http://ejohn.org/blog/how-javascript-timers-work/ So is there any way to measure the difference between the mouse button gets depressed and when it gets released? ...

How do I use System::Threading.Timer and also what are delegates invc++

Hi all i am trying to use System::Threading.Timer however it also involves delegates and the code posted on msdn is little cryptic -http://msdn.microsoft.com/en-us/library/system.threading.timercallback.aspx.it will be great if someone can explain it. ...