tagged [timer]

How do I create a batch file timer to execute / call another batch throughout the day

How do I create a batch file timer to execute / call another batch throughout the day How do I create a batch file timer to execute / call another batch through out the day Maybe on given times to ru...

18 Nov at 17:18

Why there are 5 Versions of Timer Classes in .NET?

Why there are 5 Versions of Timer Classes in .NET? Why are there five timer classes in the .Net framework, namely the following: 1. System.Timers.Timer 2. System.Threading.Timer 3. System.Windows.Form...

14 Jul at 13:49

Does Timer.Change() ever return false?

Does Timer.Change() ever return false? The .NET System.Threading Timer class has several overloaded Change() methods that return "true if the timer was successfully updated; otherwise, false." Ref: [h...

25 Sep at 16:40

Raise event in high resolution interval/timer

Raise event in high resolution interval/timer I want to use the highest possible resolution timer using c#. For example, I want to raise an event every 11 ticks (I've heard that tick is the highest po...

10 Jul at 05:0

How to set timer in android?

How to set timer in android? Can someone give a simple example of updating a textfield every second or so? I want to make a flying ball and need to calculate/update the ball coordinates every second, ...

30 Oct at 07:50

How to use timer in C?

How to use timer in C? What is the method to use a timer in C? I need to wait until 500 ms for a job. Please mention any good way to do this job. I used `sleep(3);` But this method does not do any wor...

1 Mar at 10:45

Best Timer for using in a Windows service

Best Timer for using in a Windows service I need to create some windows service which will execute every N period of time. The question is: Which timer control should I use: `System.Timers.Timer` or `...

18 Mar at 09:30

Using System.Windows.Forms.Timer.Start()/Stop() versus Enabled = true/false

Using System.Windows.Forms.Timer.Start()/Stop() versus Enabled = true/false Suppose we are using System.Windows.Forms.Timer in a .Net application, For example, if we wish to pause a timer while we do ...

18 Jun at 14:26

Trigger event using timer on a specific day and time

Trigger event using timer on a specific day and time I am using System.Timer to trigger an event. Currently I trigger it every 1 hour and check if it matches the configured value (day,time). But it is...

24 Jan at 20:5

System.Timers.Timer/Threading.Timer vs Thread with WhileLoop + Thread.Sleep For Periodic Tasks

System.Timers.Timer/Threading.Timer vs Thread with WhileLoop + Thread.Sleep For Periodic Tasks In my application I have to send periodic heartbeats to a "brother" application. Is this better accomplis...

12 May at 20:16

How to add a "sleep" or "wait" to my Lua Script?

How to add a "sleep" or "wait" to my Lua Script? I'm trying to make a simple script for a game, by changing the time of day, but I want to do it in a fast motion. So this is what I'm talking about: an...

1 Aug at 07:32

Reliably stop System.Threading.Timer?

Reliably stop System.Threading.Timer? Well I've searched a lot for a solution to this. I'm looking for a clean and simple way to prevent the callback method of a System.Threading.Timer from being invo...

3 Sep at 18:57

Is there a timer class in C# that isn't in the Windows.Forms namespace?

Is there a timer class in C# that isn't in the Windows.Forms namespace? I want to use a timer in my simple [.NET](http://en.wikipedia.org/wiki/.NET_Framework) application written in C#. The only one I...

6 Aug at 08:34

System.Windows.Forms.Timer performance

System.Windows.Forms.Timer performance We have an application containing a lot of user controls that update frequently based on a System.Windows.Forms.Timer. Am I safe to add a Timer instance to each ...

24 Jun at 17:48

Do C# Timers elapse on a separate thread?

Do C# Timers elapse on a separate thread? Does a System.Timers.Timer elapse on a separate thread than the thread that created it? Lets say I have a class with a timer that fires every 5 seconds. When ...

16 Sep at 22:36

Wait some seconds without blocking UI execution

Wait some seconds without blocking UI execution I would like to wait some seconds between two instruction, but WITHOUT blocking the execution. For example, `Thread.Sleep(2000)` it is not good, because...

3 Mar at 22:0

Disable Property of Azure Functions not working in Visual Studio 2017

Disable Property of Azure Functions not working in Visual Studio 2017 I have Azure function with timer trigger. Here the `Disable("true")` is not working. it generates the `function.json` as `"disable...

Can I use Task.Delay as a timer?

Can I use Task.Delay as a timer? I want to execute some code on each second. The code I am using now is: > Task.Run((Action)ExecuteSomething); And `ExecuteSomething()` is defined as below: ``` private...

Implementing a loop using a timer in C#

Implementing a loop using a timer in C# I wanted to replace a counter based while loop with the timer based while loop in C#. Example : ``` while(count

2 Jul at 06:34

SignalR - Checking if a user is still connected

SignalR - Checking if a user is still connected I have a hub with method that is called client-side. This method launches a timer with a delegate that runs every 10 seconds. Since it wouldn't make sen...

9 Oct at 17:38

Calculate the execution time of a method

Calculate the execution time of a method > [How do I measure how long a function is running?](https://stackoverflow.com/questions/10107140/how-to-measure-how-long-is-a-function-running) I have an I/...

23 May at 12:26

Time elapse computation in milliseconds C#

Time elapse computation in milliseconds C# I need to time the execution of a code sequence written in C#. Using DateTime.Now I get incorrect values for the millisecond field. For example: ``` int st...

2 Jan at 18:27

Synchronizing a timer to prevent overlap

Synchronizing a timer to prevent overlap I'm writing a Windows service that runs a variable length activity at intervals (a database scan and update). I need this task to run frequently, but the code ...

27 Jul at 12:24

How to fire timer.Elapsed event immediately

How to fire timer.Elapsed event immediately I'm using the `System.Timers.Timer` class to create a timer with an `Timer.Elapsed` event. The thing is the `Timer.Elapsed` event is fired for the first tim...

3 Aug at 23:27

How do I pass an object into a timer event?

How do I pass an object into a timer event? Ok so I am using `System.Timers.Timer` in .Net 4 with C#. I have my timer object like so: I have my Timer Elapsed event handler pointed at a method like so:...

2 Apr at 13:29