timer

java.util.Timer: Is it deprecated?

I read in a comment to this answer and in many other questions about scheduling (sorry, no references) that java.util.Timer is deprecated. I really hope not since I'm using it as the light way to schedule things in Java (and it works nicely). But if it's deprecated, I'll look elsewhere. However, a quick look at the API docs for 1.6 doesn...

Action after app quits?

Im currently working on a timer app similar to apple's default "Clock" utility but when the user quits, NSTimers no longer seem to have any effect would I have to use push notifications to alert the user the timer has ended, or is there some other way I can run an action on a timer after the application quits? thanks in advance ...

C programming, how can I get execution time of a program in milliseconds?

Hello, Currently I'm getting execution wall time of my program in seconds by calliing: time_t startTime = time(NULL); //section of code time_t endTime = time(NULL); double duration = difftime(endTime,startTime); Is it possible to get the wall time in milliseconds? If so how? Thanks in advance! alex ...

180 to -180 motion in opengl c++?

i'm using a glutTimerFunc(...) to achieve motion of robot arm, my problem is left side 0 degree to 90 is easily done, when i try 0 to -90 degree, the arm is not stoping? i tried various methods, but all falied, can you suggest better options? here's my timer function, void myTimerFunc(int var) { switch(var) { case 1: if(shoulder>=90) ...

Compiler errors with Actionscript Timer

I have a couple timers in a Flash application I'm building. They worked fine initially, but after building the application and adding more code to it, I'm suddenly getting these weird compiler errors. When I try to compile, I get 'error 1136: Incorrect number of arguments. Expected 0.' on the line of the Timer declaration, which looks l...

System.Timers.Timer's SynchronizingObject property

1) What thread will the System.Timers.Timer's Elapsed event run on if I set the timer's SynchronizingObject property to null? 2) Will it run? What's a use case for it, if it does? I mean, in what situation will I want to run a timer on a non-UI thread/worker thread from the thread pool? ...

Session time out with Timer in ASP.NET(C#)

I want to time out the session with timer, I am implementing a ecommerce project, where I required when user add first product in the cart a timer will start and user add more products in the cart but user did not checkout the cart product within a specific time the cart session is timeout(cart empty). How can acchive this. ...

DataBinding and Timer in WPF ?

Hi, I'm gonna write a code with DataBinding and a Timer to change an Image sequentially. e.g: in each two seconds. below is my C# code : public class GenerateRandomImagePath { Random random = new Random((int)DateTime.Now.Ticks); readonly int MinInt; readonly int MaxInt; readonly string PrefixImagesName; readonly s...

how to set the timer in c#

i am drawing numerous lines in screen . i need to put timer and draw the lines in panel one by one in c# using directx ...

Grails and timed services

I have used a groovy service on a timer in a grails app before by setting a timertask in the resources.groovy. I need to do something similar now, but can't get my head around how to do it. Basically I need a timer task again which will go off in the background and get some data and populate my database. but I also need a countdown ...

Using System.Timers.Timer in asp.net

I use the following code in a asp.net website. On application init i call InitializeTimer() once. The goal of the code was to run DoWork() once every hour (1 time per hour) . I also wanted the code to execute on different time every loop so i added the random part. The result i got was werid , i can not find a explaination why is hap...

Countdown timer iphone sdk??

I have a countdown timer in my game and I'm trying to figure out how to make it so that it shows two decimal places and records with 2 decimal places in my table. Right now it counts down as a whole number and records as a whole number. Any ideas? -(void)updateTimerLabel{ if(appDelegate.gameStateRunning == YES){ ...

java: run a function after a specific number of seconds.

Hiya. I have a specific function that i want to be executed after 5 seconds. how can i do that in java? I found javax.swing.timer, but i can't really understand how to use it. it looks like i'm looking for something way simpler then this class provides. please add a simple usage example. thanks!!!! ...

DispatcherTimer vs a regular Timer in WPF app for a task scheduler

Please, explain the difference between "DispatcherTimer" and "a regular Timer" that @Kent Boogaart meant for using in a multithreading WPF app as a task sheduler in this topic: http://stackoverflow.com/questions/1341829/advice-needed-for-multi-threading-strategy-for-wpf-application in the commentaries to one of the post (quote): -If a...

Cocoa Thread error

I'm just getting started with using threads in obj-c/cocoa and I'm running into some trouble.. I get this error in the console: 2010-02-15 09:18:41.467 Timer[1007:4503] *** __NSAutoreleaseNoPool(): Object 0x10012adc0 of class __NSCFDate autoreleased with no pool in place - just leaking 2010-02-15 09:18:41.478 Timer[1007:4503] *** __NSAu...

What happens if a TimerTask takes longer to execute than the specified interval?

When using Timer.schedule(TimerTask task, long delay, long period) (i.e. with fixed-delay execution), what happens if the specified TimerTask's run() method takes longer than period to complete? Is it possible that two concurrent TimerTask threads will be running because of this? And if so, is there a way to avoid it? ...

Why doesn't my Service work in Android? (I just want to log something ever 5 seconds)

I created a new class called HelloService. I added this to the Android manifest.xml. public class HelloService extends Service { private Timer timer = new Timer(); private long INTERVAL = 5000; public void onCreate() { super.onCreate(); startservice(); } private void startservice() { timer....

jquery plugin to show multiple elapsed time timers on a page?

Hello everybody. I need to show on a page multiple -time zone independent- elapsed time timers. I'd like to have something similar to what is shown on the NASA mission pages, where they show the mission time (e.g. http://www.nasa.gov/mission_pages/shuttle/main/index.html). I'd like to use a jquery plugin for that, so I'd like you to adv...

Timer behaving strangely!

I am facing a strange behaviour for an .aspx page. I have DataList called MyDataList. I need to conditionally highlight the rows of the DataList, depending on an arbitrary value in the data, such as if a Date field is less then SomeDate. I am using an UpdatePanel, ScriptManager and a timer (all AJAX) to refresh MyDataList. protected v...

how to automate timed running of 2 programs ?

I'm working in linux. I have two programs that run for infinite time ( that is , wont stop unless i kill the process ).i want to run program 1 first and then run program 2 after 20 seconds ( both will have to run simultaneously as one reads a file written by the other ).Currently , i am running the 2 programs by manually keeping track of...