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
1 answer

How to create timer on JINT Javascript side

I´m developing a C# project using JINT (https://github.com/sebastienros/jint), and I need to create a timer on my JS so it can execute a function on my javascript every time the timer tim set is elapsed. How can I accomplish that?. I have used…
NicoRiff
  • 4,803
  • 3
  • 25
  • 54
4
votes
1 answer

Background job to refresh data on a form while script is running?

Hope some brave will help me ! I’m working from a few days now on a Powershell tool that display a dashboard on the screen corner to give some network “real-time” diagnostics of the computer. This dashboard can be minimized in the notification…
4
votes
1 answer

Check with a timer every second, if a file exist in a given path

I have a simple console application made with C#, in which I create a zip file. From another console application, I let a timer tick every second to check if the directory where I create the .zip file in the first app contains a .zip file, but it…
4
votes
4 answers

Creating an EJB Timer in Liberty

I need to create a EJB timer (using @Schedule), but have read that this is not supported in a Websphere Liberty profile? According to a previously posted question on StackOverflow, it wasn't supported as of 08/2013: Java EE-Timer / @Schedule in…
schuno
  • 545
  • 6
  • 11
4
votes
5 answers

Need an Alternate Method to Get a 20 millisecond resolution Cycle

I need to read a message coming from a CAN network every 20ms. For this purpose I made a function which works defined below. It's kind of work around, but does the job. public void Read_CAN_RC_Message() { bool a = true; …
Abhishek Kumar
  • 342
  • 5
  • 22
4
votes
1 answer

How to stop running countdown in jquery?

I have a countdown running and on click button i want to stop this countdown.But its not working. This is my code $(document).ready(function (){ var settimmer =1000; var $dash_url=""; $(function (){ var…
Niroj Adhikary
  • 1,775
  • 18
  • 30
4
votes
2 answers

How to control a timer using Reactive Extensions (C#) without any side-effects?

I'm trying to implement the following scenario: A button is pressed down. An interval is calculated by calling the GetInterval() method. The DoSomething() method is called immediately. The DoSomething() method will be called repeatedly every…
tearvisus
  • 2,013
  • 2
  • 15
  • 32
4
votes
1 answer

Xamarin.Android Timer to update the UI - runOnUiThread

I'm developing a Xamarin.Android app that references a portable class library with viewmodels. MvvmCross is being used. I need a Timer that updates the UI every time it "ticks". I just can't seem to get it to update the UI. It is performing the Tick…
Ben
  • 259
  • 1
  • 3
  • 14
4
votes
0 answers

XCTest test for not happening before timeout

I found a lot of questions about how to write a unit test that tests whether something happens before a timeout, using something like - (void)waitForExpectationsWithTimeout:(NSTimeInterval)timeout handler:(nullable…
Infinite
  • 2,931
  • 2
  • 27
  • 33
4
votes
1 answer

Why static variable dies in Asp.Net

We know that static variable alive until the application alive. For example, we can count the number of visitor with a single static int variable. private static int numberOfVisitors = 0; protected void Page_Load(object sender, EventArgs e) { …
Mehdi Khademloo
  • 2,754
  • 2
  • 20
  • 40
4
votes
2 answers

How can I ensure thread safety in the following context?

I have a method called processOutbox. I want it to be thread safe. I don't want another thread to call this method while one thread is at it. I have implemented it the following way. Have I done it correctly? Are there any loopholes in my…
AnOldSoul
  • 4,017
  • 12
  • 57
  • 118
4
votes
2 answers

C Timer Difference returning 0ms

I'm learning C (and Cygwin) and trying to complete a simple remote execution system for an assignment. One simple requirement that I'm getting hung up on is: 'Client will report the time taken for the server to respond to each query.' I've tried…
HyperionX
  • 1,332
  • 2
  • 17
  • 31
4
votes
1 answer

AngularJS - How to make a stop watch starting from 00:00:00 format

I want to create a stop watch. I googled and got a few tips on how to make a timer. Here is what I have done in my controller: $scope.value = 0; $scope.startTimer = function() { $scope.value = 0; var change = function() { …
Sibtain
  • 1,436
  • 21
  • 39
4
votes
1 answer

Excel VBA timer performance differs depending on which sheet is active?

I have a workbook with many sheets, each sheet has varying number of equations that inter-link with each other. I have a workbook wide VBA timer that is supposed to run every 5 seconds. When I am active on a sheet that doesn't have a lot of formulas…
TheBear
  • 827
  • 2
  • 10
  • 21
4
votes
2 answers

Linux, C: terminate multple threads after some seconds (timer?)

Linux, C. I created multiple threads to run workloads, and I want to signal those threads to stop/terminate after a specified seconds/time out. How do I implement this by C? void *do_function(void *ptr) { //calculating, dothe workload…
Howard Shane
  • 926
  • 13
  • 28