timer

Typical scheduling time quantum in modern operating systems

What are typical durations of an operating system process/thread scheduling quantum? I realize that this can vary with the scheduling algorithm, priorities, workloads, hardware, etc., so I'm expecting answers to come with conditions/assumptions, or to be ballpark. I can find examples that seem to suggest something on the order of 16 mil...

How to avoid leaking handles when invoking in UI from System.Threading.Timer?

It seems like calling Invoke on a winforms control in a callback from a System.Threading.Timer leaks handles until the timer is disposed. Does anyone have an idea of how to work around this? I need to poll for a value every second and update the UI accordingly. I tried it in a test project to make sure that that was indeed the cause o...

Visual Basic 2008 Opacity Failure

Hey guys, I have a 2 files here. One is my main form, and the other is a dialog I made. Now I'm trying to get enter code here the dialog to gradually obtain its transparency from a timer which I have on the dialong form: If Me.Opacity = "100" Then Timer1.Stop() Timer1.Enabled = False Else Me....

Strange problem with JavaScript code.

Hi Masters Of Web Development, first I want to say that I did not believe in my eyes - I've got a piece of javascript that works just fine in IE7, and don't in Firefox!!! :)))) That was little joke. :) So I already told you the problem (it wasn't joke), now I'm pasting the javascript: <script type="text/javascript"> <!-- This script an...

java timer - how to scheduletask at a particular time in the future.

Hi Everyone, I have used java.util.Timer to schedule TimerTask to be run every 2 hours . But how do I schedule a task to run say everynight at 2 am ? This might be something easy, I am just overlooking something I guess. Thanks in Advance ...

jqgalscroll timer

Hi I'm trying to add a timer to the jqgalscroll plugin, the plugin has the function jqimg.click(function(){ var next = n.index + 1; if((n.index +1) == el.totalChildres) { el.pagination.find('[href$=0]').click(); } else { el.pagination.find('[href$=#'+ next+ ']').click(); } }); this is used to move to the next image in the gallery,...

Substitute the timer.

I want to call asynchronous methods, but I don't want use a timer. How can I substitute the timer? I need the invoker that substitute the timer. ...

Periodically testing of elements that are added to the DOM after pageload.

I've got a page where you upload videos, those videos are then encoded (much like Youtube). The encoding part can take some time and I want to automatically show the user if encoding is done by periodically polling the encoding status from within the page, if encoding is completed I want to replace the encoding icon with a "play" button ...

Stack.Overflow error - WinForms App Vs. WinService

I have a small code sample: private void MonitorItems() { if (someCondition) { dateSelected = DateTime.Now; GetAllItems(); } else { if(allItems.Count>0) CheckAllItems(); } Monito...

Calculating number of seconds between two points in time, in Cocoa, even when system clock has changed mid-way.

I'm writing a Cocoa OS X (Leopard 10.5+) end-user program that's using timestamps to calculate statistics for how long something is being displayed on the screen. Time is calculated periodically while the program runs using a repeating NSTimer. [NSDate date] is used to capture timestamps, Start and Finish. Calculating the difference b...

using jquery to display words consecutively

I have a page that has 2 columns of words, 20 total, that are of a certain class (dim) and each a unique id. The ‘dim’ class defines the words as hidden. I have the following jQuery code running when I press a button: $().ready(function() { var x = 20; // will be dynamic later :-) $("#btn1").click(function() { f...

Timers / Tap and Hold gesture problem in .NET CF

Hey, Ive encountered some strange behaviour in my .NET CF 2.0 application running on Windows CE 5.0. I have a timer updating a control periodically, that control can also receive Tap and Hold gestures from the user (in the mouse down handler). What I am finding is that when a TAH begins (but before it exits) a timer event can begin pro...

PHP Timer Based on Typing

Hello everyone, I'm trying to figure out the best way to create a timer that is associated with typing within a specified form field. Whenever someone starts typing the timer starts. When the person stops typing for a restroom break, phone call, etc. the timer pauses and continues where it left off when the person starts to type again...

Battery Level Will Not Update

Hello there, I am having a small problem. I am a beginner to iPhone programming so please forgive me if the answer is obvious. I have found the current charge and want it to continually update while my app is running. I tried this: - (void) viewWillAppear:(BOOL)animated { NSLog(@"viewWillAppear"); double level = [self batteryLevel]...

Multithreading in WCF with accurate timer requirement

I have a WCF app that accepts requests to start a job. Each job needs to do something after exactly X minutes (e.g. 5 mins.), there can also be a job request at any time and simultaneously. This is what I have in mind, // WCF class public class RequestManager { // WCF method public void StartNewJob() { // start a new...

Several tasks run periodically in one .NET winform app.

I will do several tasks periodically in my app, but they have different period, how to do this? run each task in a separate timer thread. run all the period task in the same timer thread, but check the time to see if the task should be activated. do you have any better solution? ...

Timer Queues, immediately terminate a timer?

I'm trying to achieve high frame-per-second on Windows GDI by using Windows Timer Queues. The relevant APIs are CreateTimerQueue, DeleteTimerQueueEx, CreateTimerQueueTimer, and DeleteTimerQueueTimer . The timer is created using CreateTimerQueueTimer(&m_timer, m_timer_queue, TimerCallback, this, 0, 20, WT_EXECUTEINTIMERTHREAD); to achiev...

C# Execute function at specific time

Hello everyone. I made a little Windows Forms program to do some auto backup of some files on my disk. Right now I need to push a button before it is executed, but I want to make the program running and at 3am run the function that does the backup. I've researched a bit and found out i need a timer for this, but I've failed to use it s...

How to set a timer in PHP?

For example, my goal is to test the code given here: http://stackoverflow.com/questions/863268/php-script-that-reports-progress-to-client <?php waitalittle(); echo 'Task one finished'; flush(); waitalittle(); echo 'Task two finished'; flush(); ?> My objective is to create the waitalittle() function, which should take 5 seconds to ...

[C#] Stopping timer in its callback method

I have a System.Threading.Timer that calls its appropriate event handler (callback) every 10 ms. The method itself is not reentrant and can sometimes take way longer than 10 ms. Thus, I want to stop the timer during method execution. Code: private Timer _creatorTimer; // BackgroundWorker's work private void CreatorWork(object sender, ...