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
5 answers

Using Timer to delay an operation a few seconds

I am trying to delay my method by using a timer: private System.Timers.Timer _delayTimer; private void delay() { _delayTimer = new System.Timers.Timer(); _delayTimer.Interval = 5000; //_delayTimer.Enabled =…
user2214609
  • 4,713
  • 9
  • 34
  • 41
4
votes
2 answers

DispatcherTimer doesn't work in Console

I'm curious as to why dispatcher timer doesn't work in console mode. I created a simple alarm that does something when the timer reaches it's limit. Can you use dispatcher timer with UnitTest or in Console mode? DailyAlarm works when I run it in a…
Pat
  • 627
  • 1
  • 9
  • 24
4
votes
2 answers

Best Way to execute a function at a given time frequency (timer)?

I have a small program that needs to be run in a small Linux embedded system (ARM). It is written in C. It needs to poll some data (2x64-bit) from an API provided by the system manufacturer, and then do some calculations and send the data through…
fazineroso
  • 7,196
  • 7
  • 31
  • 42
4
votes
3 answers

How to disable the click if a function is in active status

I have created a fiddle of my function here( http://jsfiddle.net/rhy5K/10/ ) . Now i want to disable the button click i.e play/pause if the sound is playing like Get ready,5,4,3,2,1 . I know only how to disable the form submit button , but I am…
beginner
  • 665
  • 6
  • 14
  • 31
4
votes
2 answers

How to convert seconds of Timer to hh:mm:ss?

I am truely sorry if asking the same question twice is considered spamming as I already asked about backward timer a hour ago. But now new problem with it is though I couldn't get anyone's attention to that question again. I have successfully coded…
Hashan Wijetunga
  • 181
  • 2
  • 3
  • 9
4
votes
1 answer

Web Worker Sleep

I know you will all be going like "use timers!" but let me explain. I'm making something like macro and I need functions to be executed with a specific delay. I know that it can be done with timers, but how would a code look with 50 timers and 50…
Intel
  • 61
  • 6
4
votes
4 answers

Timer vs. repetitive background worker

I am developing a Windows Forms application that calls a WCF service after a specified interval and shows output according to the data received from the service. I had a plan to use timer for this purpose that calls that WCF service method after 500…
Aishwarya Shiva
  • 3,460
  • 15
  • 58
  • 107
4
votes
0 answers

Google analytics iOS SDK 3.01 App speed not tracking

On device log I am receiving next info VERBOSE: GoogleAnalytics 3.01 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:414): Saved hit: { parameters = { "&_u" = ".ojL"; "&_v" = "mi3.0.1"; …
Max Tymchii
  • 826
  • 8
  • 16
4
votes
3 answers

Timer callback raised every 24 hours - is DST handled correctly?

I just thought about the way I solved a service which runs a task every 24 hours and how DST could possibly hurt it. To run the task daily, I used a System.Threading.Timer with a period of 24 hours, like this: _timer = new…
Ray
  • 7,940
  • 7
  • 58
  • 90
4
votes
1 answer

Poco Timer Example

The following was asked by a coworker and after poking around the internet and not finding a good answer it seemed like a good question for here: I am using POCO timers in my embedded code(running on Linux). The timers are a part of the Foundation…
Ryan Higgins
  • 232
  • 4
  • 9
4
votes
3 answers

System.Threading.Timer callback is never called

My System.Threading.Timer (which has a callback) never fires reliably. This is part of my programming assignment where I input the amount of time the timer is supposed to run from a textbox. The timer is declared like this: System.Threading.Timer…
docaholic
  • 613
  • 9
  • 29
4
votes
4 answers

Multiple timers in C

I have an application which needs to do the following: If an event happens (a disconnect from server), a long timer is started (say 5 minutes). The application then tries to reconnect to the server. If the reconnect fails, a short timer is started…
TomSelleck
  • 6,706
  • 22
  • 82
  • 151
4
votes
3 answers

VB.net real-time time elapsed feature

I already have created a real time clock that synchronizes with the computer time and is being displayed in a label. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Timer1.Enabled = True End Sub Private Sub…
Marc Intes
  • 737
  • 9
  • 25
  • 51
4
votes
1 answer

C# how to stop thread in time?

I have an user control which include timer. When timer event run, it will call some threads. User Control class MyControl { public Timer iTime { get; set; } Timer tmr; public MyControl { tmr = new…
Blishton
  • 109
  • 2
  • 9
4
votes
0 answers

Is there a completely portable way to check for clock_gettime() or comprehensive list of platforms that have it?

I'm trying to write a small C++ utility library that (among other things) makes the clock_gettime() API available on virtually any platform.* Basically, I want to check whether clock_gettime() exists, use the native implementation if it's…
Mike S
  • 531
  • 4
  • 14
1 2 3
99
100