timer

How to implement a timer keypress in bash?

Here's what will happen, a message is displayed with a specified time waiting for keypress, if no keypress then it will resume. Example "Press ESC to exit, otherwise you will die.. 3..2..1" "Press 'x' to procrastinate and check email, read some blogs, facebook, twitter.. otherwise you will resume work for 12 hours.. 3..2..1" This sho...

.NET - System.Timers.Timer question

I want to ask if a System.Timers.Timer instance runs on a single thread, a thread pool, or something else? If it does run on a single thread, what do you think would be best for this example: I want to update all character's health every minute I want to update all character's energy every 2 seconds I want to update all character's sp...

poll/epoll compatible Timer

Greetings, I was wondering if there is a way to use a timer in combination with linux poll/epoll API. I already use epoll and it would integrate very nice with the existing code if i could make the timer to be just another epoll event in my queue. A possible way is maybe, a file-based Timer, like echo 400;now > /dev/timer ; cat /dev/t...

Is it safe to use java.util.Timer inside servlet ?

Hi all, for many reasons, it is not good practice to use threads inside servlet. java.util.Timer seems like wrapper to threads. so also it is not safe to use it ? if yes, what is the safest way to schedule task in servlet ? thanks,,, ...

Django timer thread

Hello, I would like to compute some information in my Django application on regular basis. I need to select and insert data each second and want to use Django ORM. How can I do this? ...

Launch Application within an Thread, using Timer

Hi all, I'll try explain me as better possible, sorry my english. I have a Thread, within this thread I call method, which have long time process. The method has a foreach, and using counter for each iteration (counter++) I want to do this: a). Within foreach, if counter > 20: a1). Check if any proccess (which Name = "SendMailServi...

[C#] Timers and Forms not closing when method called.

I have three seperate timers that call a method in each of their _Tick. This method works fine, as intended, but within it is an if statement which checks to see if two values are either < or > than a number: if ((x < y) || (x > z)) { } and within this statement, I want to stop those three times, show a message box and dispose the fo...

How dispose timer?

How dispose System.Threading.Timer correctly? I have got this result: pub_MyEvent1 pub_MyEvent1 pub_MyEvent1 pub_MyEvent1 new pub_MyEvent pub_MyEvent1 new pub_MyEvent Code: class Program { static void Main(string[] args) { Publisher pub = new Publisher(); pub.MyEvent += new EventHandler(pub_MyEvent1); ...

Common Lisp Timer

I would like to start a timer in my common lisp application that after a certain amount of time it will call a certain method. What would be the best way to accomplish this? ...

In Gtk#, how do I reset a timer that was set with GLib.Timeout.Add?

I'd like to save the state of a widget once it has not been editted for 2 seconds. Right now, my code looks something like this: bool timerActive = false; ... widget.Changed += delegate { if (timerActive) return; timerActive = true; GLib.Timeout.Add (2000, () => { Save (); timerActive = false; ...

Timer Class in ASP.NET

I have this code in the asp.net application start evert, and I'm not really familar with the Timer class but what I want to do is have one Trigger that goes off every night at 11 pm, one that goes off at 5:30 in the morning and then every hour after that. private System.Threading.Timer timer; protected void Application_Start(object send...

kernel timer objects and synchronization

I wondered if anyone can tell me simply (I know this is not a simple subject) how kernel timer objects are used to synchronize access to data structures in the kernel? EDIT: A kernel timer object is part of the kernel's dispatcher objects, which are the kernel's group of synchronization objects. I wanted to also know if the timer obje...

How do 2 or more threads get synchronized using a timer in the Windows kernel?

I have been reading about the kernel using timers for thread synchronization. I haven't been able to find a decent explanation on how thread sync with timers works, I wondered if anyone can help me? MSDN: Kernel Dispatcher objects DPCs and timer objects <-- here it talks about 'synchronization timers' Also reading book Windows Intern...

countdown timer in javascript

Does anyone knows countdown timer using javascript?? ...

What is the best way to delay thread starts until a specific time?

I am building an application which needs to call a certain API at specific times. I would like to set execution times for each of the calls, and have my execute function be called automatically when each call needs to execute. What's the best way to do this? I have thought about creating a new Timer for each new call that needs to be ex...

android timer swing

I need to create a Timer to update the UI at regular intervals. But the Swing Timer class is not available on Android. How can I work around this problem ? (I would avoid creating threads and then use the Timer class from java.util package) ...

java timers: how to select + what are the limitations?

I need to write some code to stress-test RS232 communication using rxtx (note: this question is NOT about serial communications, so please don't go there), and I would like to periodically send bytes using some kind of timer task. Are there any kind of guidelines online about what kind of timer class to use for various applications? I'm...

C# 2.0 Execution Time Timer

I would like to be able to calculate the amount of time a number of functions take to execute. I was thinking about using some type of stopwatch class. I can call start/stop before and after each function call, however that seems horribly ugly to me. Is there a way to do this without a stopwatch class? Can something in the Reflections c...

C# timer for database cyclic polling

I'm not very familiar with C# so far, at least not enough to feel confident when choosing ways of doing something when it comes for the first time. What could be the best way to organize SQL Server database timer based polling from my WPF application for controls updating? Could you please share some thoughts on this issue or, maybe, ...

Calculating packet travel time in JavaScript

My server broadcasts a packet to a browser client every now and then. Is there any way to figure out how long it took from the packet from: server --> client I'm trying to time something, so ideally my JavaScript function would be like: var travelTime = {amount of time it took packet to get to me}; setTimeout('myFunction()', 3000 + ...