timer

STL Priority Queue - deleting an item

Hello, I want to implement a timer queuing system using the C++ STL priority_queue container adapter. My problem is that I want to occasionally cancel a timer, however there are no interfaces that enable me to easily delete an item in the priority_queue that is not the top item. Any suggestions?. Thank you for your help. ...

Changing the interval of a NSTimer

Hi Can anyone tell me if its possible to change the interval of an NSTimer while its firing? Seems like this should be possible but haven't figured out how... Basically I'm trying to create a 'deceleration' effect. ...

Create a Timer in MySQL

I have a backup system..... that backs up a folder every 5 minutes. The backup can be assigned to any device using its IP Address. But once a week or once a month that device is rebooted, and we want to turn the backup off every week or month on a certain time for certain seconds. Creating the database table shouldn't be a problem, I was...

Limit posting to every 30 minutes

Hey. Thanks for looking. I'm trying to write a script to set a cookie after the user posts a comment, limiting them from posting again for 30 minutes. I'm so confused on where to start. Please, could you guys help me out on how I do this? I'm trying to use this jquery plugin – countdown timer. ...

PHP timer without script pause/delay

So I just want to write this quick and dirty module to a program that takes the current time, echos a string, and then waits x minutes and echos another string. The only thing is, is this little module stops the rest of the program until it's finished. Any way around this? ...

Calling a NSTimer method

Hi I'm new to working with timers on the iPhone and would need some support. I have a method as below that takes the time and update a label in my user interface. I also have an NSTimer that calls that method once a second (I only show hours and minutes). This works just fine, except for the first second the App is live (as I understa...

How to pass parameters to the function called by ElapsedEventHandler?

How to pass parameters to the function called by ElapsedEventHandler? My code: private static void InitTimer(int Index) { keepAlive[Index] = new Timer(); keepAlive[Index].Interval = 3000; keepAlive[Index].Elapsed += new ElapsedEventHandler(keepAlive_Elapsed[, Index]); keepAlive[Index].Start(); } public static void keep...

Using many System.Timers.Timer objects

I have an application which makes use of System.Timers.Timer objects to do expirations and email notifications and such. Currently the system has a couple hundred timers alive at once, but we are going to be expanding the usage of the app and that number might start scaling into the thousands (probably no higher than 10,000). I can't fi...

using ScheduledExecutorService to start and stop timer

From my readings, it seems that ScheduledExecutorService is the right way to start and stop timers in Java. I need to port some code that starts and stops a timer. This is not a periodic timer. This code, stops the timer before starting it. So, effectively every start is really a restart(). I am looking for the right way to do this usin...

a count down android timer back button vs home

I am writing a count down timer, using .postdelayed(), that speaks each second as the timer goes down to zero. I have trouble understanding the consequences of the user hitting the back or home button. The countdown continues when hitting either button. When home is pressed and you reclick the app, it goes back to the same count(this...

Skip to end of time quanta

Is it possible to skip to the end of a process's allocated time-quantum? I have a program that works in parallel on a piece of shared memory, and then all of the processes need to wait for the others to finish and sync up before the next step. Each process will do a maximum of one iteration more than any other, so any timing difference...

Countdown timer with cookies

Hi, I know there have been a lot of topics like this but I just have problem to which I couldn't find the answer. My script is: window.onload = function(){ // 200 seconds countdown var countdown = 14400; //current timestamp var now = Date.parse(new Date()); //ready should be stored in your cookie if ( !docum...

Linux, timerfd accuracy

I have a system that needs at least 10 mseconds of accuracy for timers. I went for timerfd as it suits me perfectly, but found that even for times up to 15 milliseconds it is not accurate at all, either that or I don't understand how it works. The times I have measured were up to 21 mseconds on a 10 mseconds timer. I have put together...

Best way to test code speed in C++ without profiler, or does it not make sense to try?

On SO, there are quite a few questions about performance profiling, but I don't seem to find the whole picture. There are quite a few issues involved and most Q & A ignore all but a few at a time, or don't justify their proposals. What Im wondering about. If I have two functions that do the same thing, and Im curious about the differenc...

Adobe Flex Timer Event

Hello everyone, I just have a one quick question on Timer and TimerEvent (flash.events.TimerEvent & flash.utils.Timer) of Adobe Flex. I am currently working on a project wherein I need to occasionally change speed, stop and play an swf animation (loaded to a loader and instantiated as a ByteArray). Example, I have a moving car (swf ...

Retrieve a reference to CountDownTimer after Closed activuty

My activity has a simple menuItem that start a counter... the counter is stored in a field of the activity the problem is with the "back button" after closing the activity (back button), the timer (as in my intention) continues, and restarting the activity behave correctly by reshowing the timer... but I lost the reference to the counte...

Design Qn RE: System-wide timer (C#). What timer in what layer?

Hi all, Thanks for taking time to read this question. I am designing a 3-tier solution written in c# that needs to carry out processing every minute. The processing should be initiated at the same time from different unconnected parts of the program. What's the best way to implement a system-wide timer? Should it be in the business ...

C#: What if System.Windows.Forms.Timer interval was not enough for doing a job ?

hi First, sorry for my bad english writing. Suppose that we have a win form (C#) that has a timer. The timer interval has been set to 60000 milsec. So its tick event will be fired every 1 milute. Suppose we have written a method that handles tick event called Timer1_Tick. What if the job needs more that 1 minute to complete? ...

timer inside a thread

how to start a forms.timer inside a simple thread,i have a problem where i need to start a timer inside a thread,how can i do that ...

How to setup timer resolution to 0.5 ms?

I want to set a machine timer resolution to 0.5ms. Sysinternal utility reports that the min clock resolution is 0.5ms so it can be done. P.S. I know how to set it to 1ms. P.P.S. I changed it from C# to more general question (thanks to Hans) System timer resolution ...