Questions tagged [timer]

Timer is a component that has the functionality to trigger a user defined action at regular intervals as configured by the user.

Timer is a component that has the functionality to trigger a user defined action at regular intervals as configured by the user.

Some timers (such as Java Swing timer, WPF DispatcherTimer, WinForms Timer) are also capable of firing they events in GUI thread so there is no need to switch into this thread in order to update the components. Other timers do not have this capability and are more optimized to handle big number of scheduled events.

Depending on how does the scheduler behaves if the new even should be fired when the current event has not yet been fully processed, the timer may be coalescing or non coalescing. A coalescing timer reduces multiple pending events to a single event, reducing the number of events to handle. A non-coalescing timer fires pending overtime events in rapid succession with no delay between them, in order to catch up.

19566 questions
4
votes
3 answers

Timer not running all elapsed event handler

currently facing this issue with a timer. I basically want to create a timer which will execute after a button press. this will then count to 5 and then close the window which is created from the class. Below is what I have at the moment. public…
Khal786
  • 67
  • 8
4
votes
2 answers

ScheduledExecutorService.scheduleAtFixedRate And Setting initialDelay To Date In The Past

I'm working on a scheduling system in Java that sends out reminders based on a startDate, endDate and occurrence (hourly, daily, weekly, monthly, Mondays, etc). Originally I was using Timer and TimerTask classes to schedule the reminders: Timer…
Dale Zak
  • 1,106
  • 13
  • 22
4
votes
1 answer

Combine RxSwift timer and interval observables into a single observable with completion

I'd like to create an observable that behaves behaves something like this. var count = 0 func setupCountdownTimer() { let rx_countdownTimer = CountdownTimer.observable(5) rx_countdownTimer >- subscribeNext { secondsRemaining in …
clozach
  • 5,118
  • 5
  • 41
  • 54
4
votes
1 answer

Start timer on button click

I'm new in Android programming but i know Java. My question is, how does a timer work in Android? I've read that is better to use a handler. What I want to do is, you click a button and the timer starts. To the moment when the button is clicked all…
Phil
  • 304
  • 1
  • 5
  • 12
4
votes
2 answers

How can I auto segue when a timer finishes?

I want to auto segue when a timer runs out. I have a timer constructed here: class Timer{ var timer = NSTimer(); // the callback to be invoked everytime the timer 'ticks' var handler: (Int) -> (); //the total duration in seconds for which the…
Michael Ninh
  • 772
  • 2
  • 10
  • 23
4
votes
1 answer

wpf storyboard death

C#: public partial class MainWindow : Window { Storyboard a = new Storyboard(); int i; public MainWindow() { InitializeComponent(); a.Completed += new EventHandler(a_Completed); a.Duration =…
RoKK
  • 617
  • 8
  • 17
4
votes
1 answer

resetting column values after time

I am fairly new to phpmyadmin and SQL Databases. I would like to know how I can add a "script" that resets a value in all columns of a table after a certain time period -> I want the column to set the int value to 0 every 72hours for every row. Is…
Brinkhoff
  • 43
  • 1
  • 3
4
votes
1 answer

Objective-C: Adding 10 seconds to timer in SpriteKit

I used someone else's code for writing a timer in SpriteKit, and tweaked it a bit. Here's what my code looks like: - (void)createTimerWithDuration:(NSInteger)seconds position:(CGPoint)position andSize:(CGFloat)size { // Allocate/initialize the…
Christian Kreiter
  • 610
  • 1
  • 5
  • 16
4
votes
1 answer

Close TrayIcon Balloon Programmatically

Is it possible to close the TTrayIcon Balloon hint programmatically? The problem: I have a timer which checks for messages every minute. When it discovers a message (eg. ABC Service is stopped), it shows the balloon with the message: procedure…
Alisson Reinaldo Silva
  • 10,009
  • 5
  • 65
  • 83
4
votes
3 answers

Trying to create an accurate timer with GCD

I'm trying to make a music app that needs a very precise timer (it needs to be synced with background music). And I need to display the timer as a progress bar on the UI too. I initially started with NSTimer, turned out to be not accurate at all,…
Jin Wang
  • 254
  • 1
  • 7
  • 19
4
votes
2 answers

setTimeout controls

I am new at jquery and I was wondering what is the best way to make something similar to slideshow which would change pictures and picture button status on itself after interval of time. Until someone will click any of images buttons then auto…
Deividas
  • 69
  • 1
  • 9
4
votes
1 answer

How can I make my own timer without standard library?

Is there some specific number of iterations, that I could make using a for loop, so that it exactly takes 1 second for the loop to be executed completely? For example the following code took 0.125s on my machine to execute: #include…
anshabhi
  • 423
  • 6
  • 29
4
votes
1 answer

How accurate is python's threading.Timer over extremely long intervals (days)?

I have a server application that needs to schedule functions to be called at various times during the week, with a desired accuracy of plus or minus 15 seconds, let's say. threading.Timer is the simplest solution, but I'm concerned about accuracy…
Rob
  • 75
  • 1
  • 4
4
votes
1 answer

Is there a way to use one Timer for multiple events?

I am in C# .NET 3.5 What happens when timer elapses and event handler is performed ? Does the timer cease to exist ? Can I register several events in different time on one timer, expecting them all to fire one after another ?
Sold Out
  • 1,321
  • 14
  • 34
4
votes
3 answers

Millisecond interval for DispatcherTimer

I'm using a DispatcherTimer to call a void in C#: counter = new System.Windows.Threading.DispatcherTimer(); counter.Tick += new EventHandler(counter_Tick); counter.Interval = new TimeSpan(0, 0, 1); …
user1785715
  • 180
  • 1
  • 1
  • 8